Tuesday, October 10, 2017

Re: [google-cloud-sql-discuss] Why don't my tables show up for other users?

Hi Validmir,

I am pretty sure I have been specifying the database name every time I connect. When I connect with the primary user, I use this url: postgresql://postgres:[PASSWORD]@[IP ADDRESS]/datasets. And when I connect with the second user, I use this one: postgresql://user_2:[PASSWORD]@[IP ADDRESS]/datasets. However, when I connect with the first account and run the query
SELECT * FROM INFORMATION_SCHEMA.TABLES
WHERE
"table_type" = 'BASE TABLE' AND "table_schema" = 'public'

I can see the seven tables that I uploaded. But when I run the same query using 'user_2', I don't see any of those tables listed.

On Tuesday, October 10, 2017 at 10:11:41 AM UTC-4, Vladimir Rusinov wrote:
Hi Matthew,

Please make sure you connect to the same database. Usually PostgreSQL clients will connect to the same database name as username by default. I.e. if you don't specify database name, user 'postgres' will connect to 'postgres', and 'otheruser' will connect to different, 'otheruser' database.

Also, make sure new user has permissions to access objects created by 'postgres'.  Please follow official PostgreSQL documentation when checking this, e.g. https://www.postgresql.org/docs/9.6/static/ddl-priv.html and related pages, as well as pointers from CloudSQL documentation: https://cloud.google.com/sql/docs/postgres/users

--
Vladimir Rusinov
PostgreSQL SRE, Google Ireland

Google Ireland Ltd.,Gordon House, Barrow Street, Dublin 4, Ireland
Registered in Dublin, Ireland
Registration Number: 368047

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/a6ae6d05-ea0b-4097-9393-b878a090ec35%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment