Thread: User tables

User tables

From
"Hrishikesh Deshmukh"
Date:
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

Re: User tables

From
Bricklen Anderson
Date:
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';

Re: User tables

From
"chris smith"
Date:
> > 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