> -Original Message-
> From: Tom Lane [mailto:[EMAIL PROTECTED]
> Sent: 17 May 2006 15:07
> To: Dave Page
> Cc: pgsql-sql@postgresql.org
> Subject: Re: [SQL] Recursive SELECT problem
>
> "Dave Page" writes:
> > I'm trying to write a
"Dave Page" writes:
> 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.
Those privileges don't inherit, so I'm not sure why you need a recursive
check.
The usual example of a tree structure in SQL books is called an
adjacency list model and it looks like this:
CREATE TABLE Personnel
(emp CHAR(10) NOT NULL PRIMARY KEY,
boss CHAR(10) DEFAULT NULL REFERENCES Personnel(emp),
salary DECIMAL(6,2) NOT NULL DEFAULT 100.00);
Personnel
emp