Обсуждение: User tables

Поиск
Список
Период
Сортировка

User tables

От
"Hrishikesh Deshmukh"
Дата:
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

От
Bricklen Anderson
Дата:
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

От
"chris smith"
Дата:
> > 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