User tables

Started by Hrishikesh Deshmukhabout 20 years ago3 messagesgeneral
Jump to latest
#1Hrishikesh Deshmukh
hdeshmuk@gmail.com

Hello All,

Suppose there 3 users red, green, blue. How can the user green know what
tables he has created?!

From psql command line \dt lists every table in the DB!!!

Thanks in advance.

Hrishi

#2Bricklen Anderson
banderson@presinet.com
In reply to: Hrishikesh Deshmukh (#1)
Re: User tables

Hrishikesh Deshmukh wrote:

Hello All,

Suppose there 3 users red, green, blue. How can the user green know what
tables he has created?!
From psql command line \dt lists every table in the DB!!!

Thanks in advance.

Hrishi

If you mean that the owner of the table(s) is the user "green", then try
select * from pg_tables where tableowner='green';

#3Chris
dmagick@gmail.com
In reply to: Bricklen Anderson (#2)
Re: User tables

Suppose there 3 users red, green, blue. How can the user green know what
tables he has created?!
From psql command line \dt lists every table in the DB!!!

Thanks in advance.

Hrishi

If you mean that the owner of the table(s) is the user "green", then try
select * from pg_tables where tableowner='green';

or from inside psql:

\z