Re: WITH clause - Mailing list pgsql-hackers

From Alvaro Herrera Munoz
Subject Re: WITH clause
Date
Msg-id 20031212190754.GA11548@dcc.uchile.cl
Whole thread Raw
In response to WITH clause  (David Fetter <david@fetter.org>)
Responses Re: WITH clause
List pgsql-hackers
On Fri, Dec 12, 2003 at 10:13:56AM -0800, David Fetter wrote:

> I'm looking to the SQL WITH clause as a way to get better regex
> support in PostgreSQL.  I've been chatting a little bit about this,
> and here's an idea for a behavior.  Implementation details TBD.

I think you could be rather looking at keeping the regmatch_t * from
RE_compile_and_execute somewhere in the TopTransactionContext, and
create accessor functions to it.  You could do

BEGIN;
SELECT ... x ~ '([0-9]+)x([0-9]+)';
SELECT regex_parens(1), regex_parens(2);
COMMIT;

Etc, you get the idea.  Of course you could only access the captured
expressions from the last regex, and only within the same transaction
block.

-- 
Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
Maybe there's lots of data loss but the records of data loss are also lost.
(Lincoln Yeoh)


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Resurrecting pg_upgrade
Next
From: "Roderick A. Anderson"
Date:
Subject: Re: 7.4 build problem on Linux Vserver