pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: James Robinson <jlrobins@socialserve.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Utility of recursive queries?
Date: Fri, 09 Apr 2004 12:35:44 -0400
Message-ID: <26575.1081528544@sss.pgh.pa.us> (raw)
In-Reply-To: <EF02401A-8A32-11D8-8620-000A9566A412@socialserve.com>
References: <EF02401A-8A32-11D8-8620-000A9566A412@socialserve.com>

James Robinson <jlrobins@socialserve.com> writes:
> Given a reference to id=3, would a recursive query be the trick to 
> unrolling the list to discover id=1 as the head using a SQL one-liner? 

I think you could do it, but don't have the syntax in my head.

> would any potential recursive query implementation be 
> noticably more efficient that a straightforward implementation in 
> plpgsql

Most likely not ...

			regards, tom lane



view thread (3+ messages)

Message-ID: <26575.1081528544@sss.pgh.pa.us>
Permalink:  ../26575.1081528544@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/26575.1081528544@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jlrobins@socialserve.com
  Subject: Re: Utility of recursive queries?
  In-Reply-To: <26575.1081528544@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox