Re: WITH clause

From: Alvaro Herrera Munoz <alvherre(at)dcc(dot)uchile(dot)cl>
To: David Fetter <david(at)fetter(dot)org>
Cc: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: WITH clause
Date: 2003-12-12 19:07:54
Message-ID: 20031212190754.GA11548@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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[(at)]dcc(dot)uchile(dot)cl>)
Maybe there's lots of data loss but the records of data loss are also lost.
(Lincoln Yeoh)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Doug McNaught 2003-12-12 19:11:52 Re: Read-only column
Previous Message Tom Lane 2003-12-12 19:00:09 Resurrecting pg_upgrade