Re: Add schema to the query

Поиск
Список
Период
Сортировка
От Igor Korot
Тема Re: Add schema to the query
Дата
Msg-id CA+FnnTza8sohzx4fHvkf19BfuiSzwLmQc7-XkHcqyXAtXXdaZA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Add schema to the query  (Rob Sargent <robjsargent@gmail.com>)
Список pgsql-general
Rob,

On Sun, May 6, 2018 at 11:54 PM, Rob Sargent <robjsargent@gmail.com> wrote:
>
>
>> On May 6, 2018, at 8:19 PM, Igor Korot <ikorot01@gmail.com> wrote:
>>
>> Hi, ALL,
>>
>> Is there an easy way to add the schema to the following query:
>>
>> SELECT u.usename FROM pg_class c, pg_user u WHERE u.usesysid =
>> c.relowner AND relname = ?
>>
>> Thank you.
>>
> Are you looking for the owner of a particular schema.tablename?

Yes, I am.

That;s what I ended up with:

SELECT u.usename FROM pg_class c, pg_user u, pg_namespace n WHERE
n.oid = c.relnamespace AND u.usesysid = c.relowner AND n.nspname = ?
AND relname = ?

Thank you.


В списке pgsql-general по дате отправления:

Предыдущее
От: SRINIVASARAO OGURI
Дата:
Сообщение: Re: postgres on physical replica crashes
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: psycopg2.DataError: invalid input syntax for integer: ""