Recursive SELECT problem - Mailing list pgsql-sql

From Dave Page
Subject Recursive SELECT problem
Date
Msg-id E7F85A1B5FF8D44C8A1AF6885BC9A0E40138824D@ratbert.vale-housing.co.uk
Whole thread Raw
Responses Re: Recursive SELECT problem
List 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 by date:

Previous
From: Kis János Tamás
Date:
Subject: Re: Database OID
Next
From: Niklas Johansson
Date:
Subject: Re: Table constraints and INSERT