Re: [GENERAL] Results of stored procedures in WHERE clause

2008-05-23 Thread Roberts, Jon
I'm assuming you are having problems because the tree structure allows for n levels and you need to get all of the child records. I am guessing you mean this: create table cms_items (itm_id integer primary key not null, itm_parent integer default 0 not null, url varchar(100) not null); insert

Re: [GENERAL] Results of stored procedures in WHERE clause

2008-05-22 Thread Justin Pasher
> -Original Message- > From: [EMAIL PROTECTED] [mailto:pgsql-general- > [EMAIL PROTECTED] On Behalf Of Gordon > Sent: Tuesday, May 20, 2008 11:03 AM > To: pgsql-general@postgresql.org > Subject: [GENERAL] Results of stored procedures in WHERE clause > > I have a table representing tree str

Re: [GENERAL] Results of stored procedures in WHERE clause

2008-05-22 Thread Adam Rich
> > I need to be able to do queries that restrict my result set to items > belonging to a specified site and ignore all nodes that belong to > different sites. To determine the ID of the site an item belongs to I > wrote a stored procedure: > > This returns the ID of the root node for non-root

Re: [GENERAL] Results of stored procedures in WHERE clause

2008-05-22 Thread Gordon
On May 20, 5:02 pm, Gordon <[EMAIL PROTECTED]> wrote: > I have a table representing tree structures of pages on a website. > they have an itm_id column (integer key) and an itm_parent column > (pointer to item's parent node). Any item with an itm_parent of 0 is > a root node, representing a websit