Recursive SELECT problem

Поиск
Список
Период
Сортировка
От Dave Page
Тема Recursive SELECT problem
Дата
Msg-id E7F85A1B5FF8D44C8A1AF6885BC9A0E40138824D@ratbert.vale-housing.co.uk
обсуждение исходный текст
Ответы Re: Recursive SELECT problem  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
Hi,

I'm trying to write a query to determine whether or not the current
login role has CREATEDB (or CREATEROLE) privileges, either directly or
inherited from a parent role.

The query:

SELECT EXISTS (SELECT 1 FROM pg_authid WHERE rolcreatedb = TRUE AND
pg_has_role(rolname, 'MEMBER')) AS has_createdb

does the job for CREATEDB, except that it doesn't honour rolinherit.
Anyone know how I can do this in pure SQL?

Thanks, Dave.


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

Предыдущее
От: Kis János Tamás
Дата:
Сообщение: Re: Database OID
Следующее
От: Niklas Johansson
Дата:
Сообщение: Re: Table constraints and INSERT