[GENERAL] Not possible to compare regrole in a view query?

Поиск
Список
Период
Сортировка
От Glen Huang
Тема [GENERAL] Not possible to compare regrole in a view query?
Дата
Msg-id E919872C-26DB-4915-BB58-402C25F59A3E@gmail.com
обсуждение исходный текст
Ответы Re: [GENERAL] Not possible to compare regrole in a view query?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
I have this simple view definition:

CREATE TEMP VIEW user_schema AS
    SELECT nspname AS name FROM pg_namespace
    WHERE nspname = 'public' OR nspowner = ‘rolename'::regrole;

But it fails to create the view by complaining: constant of the type "regrole" cannot be used here

If I run the query directly, I get the correct result.

Does that mean I can’t compare role name this way in view? Should I use join to work around it?

Thanks.

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

Предыдущее
От: Nico Williams
Дата:
Сообщение: Re: [GENERAL] Create Action for psql when NOTIFY Recieved
Следующее
От: Milen Blagojevic
Дата:
Сообщение: [GENERAL] CREATE TABLE LIKE including all not including storage parameters?