Re: [SQL] Recursive SELECT problem

2006-05-17 Thread Dave Page
> -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

Re: [SQL] Recursive SELECT problem

2006-05-17 Thread Tom Lane
"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.

[SQL] Recursive SELECT problem

2006-05-17 Thread Dave Page
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_creat

Re: [SQL] Recursive select

2001-11-01 Thread --CELKO--
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

[SQL] Recursive select

2001-05-28 Thread Martin Smetak
Hi all! Anyone know if it's possible to make a recursive select from a table ? My problem: I got a table of "some categories" which all points to its parrent one(tree)...shown below. And I want to select all names of parrent categories of one child, lets say "fast[4]". Now I'm solving that with m

[SQL] Recursive select

2001-05-24 Thread Daniel Wickstrom
> "Martin" == Martin Smetak <[EMAIL PROTECTED]> writes: Martin> Hi all! Anyone know if it's possible to make a recursive Martin> select from a table ? My problem: I got a table of "some Martin> categories" which all points to its parrent Martin> one(tree)...shown below. And

[SQL] Recursive select

2001-05-23 Thread Martin Smetak
Hi all! Anyone know if it's possible to make a recursive select from a table ? My problem: I got a table of "some categories" which all points to its parrent one(tree)...shown below. And I want to select all names of parrent categories of one child, lets say "fast[4]". Now I'm solving that with m