From: Louis-David Mitterrand <vindex+lists-pgsql-sql@apartia.org>
To: pgsql-sql@postgresql.org
Subject: query to select a linked list
Date: Wed, 9 May 2007 14:55:20 +0200
Message-ID: <20070509125520.GA17497@apartia.fr> (raw)
Hi,
To build a threaded forum application I came up the following schema:
forum
------
id_forum | integer| not null default nextval('forum_id_forum_seq'::regclass)
id_parent| integer|
subject | text | not null
message | text |
Each message a unique id_forum and an id_parent pointing to the replied
post (empty if first post).
How can I build an elegant query to select all messages in a thread?
Thanks,
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: vindex+lists-pgsql-sql@apartia.org
Subject: Re: query to select a linked list
In-Reply-To: <20070509125520.GA17497@apartia.fr>
* 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