Skip site navigation (1) Skip section navigation (2)

Re: WIP: pl/pgsql cleanup

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: WIP: pl/pgsql cleanup
Date: 2005-02-11 01:48:08
Message-ID: 5277.1108086488@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-patches
Neil Conway <neilc(at)samurai(dot)com> writes:
> Attached is a revised patch that removes "embedded" and updates the
> regression tests. I'll apply this to HEAD later today barring any
> further suggestions for improvement.

You've broken the FOR syntax.  You may not assume that the first token
of a FOR-over-SELECT is literally SELECT; it could for example be a left
parenthesis starting some kind of UNION construct.  This is why it's so
hard to do it right, and why the old way was so messy.  (As of CVS tip
it also works to do something like
	for x in explain analyze select ...
I will grant that that didn't work before today, but it wasn't plpgsql's
fault that it didn't.)

I suggest you go back to the old parsing code for FOR.

I think it's a bad idea to entirely override the error context stack as
you do in check_sql_expr().  I can see the case for removing the
immediately previous entry, if you're sure it is
plpgsql_compile_error_callback(), but that doesn't translate to it being
a good idea to knock out any surrounding levels of context.

(Also I thought you were going to reword the "embedded" message?)

The head comment added to do_compile could stand some copy-editing :-(

Otherwise it looks pretty good...

			regards, tom lane

In response to

Responses

pgsql-patches by date

Next:From: Peter EisentrautDate: 2005-02-11 01:53:00
Subject: Re: Clarify use of NOW() in pl/pgsql docs
Previous:From: Neil ConwayDate: 2005-02-11 01:26:59
Subject: reject empty string in float[48], oid

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group