Re: [PATCHES] final light versions of Oracle compatibility (SQLSTATE,

2005-06-10 Thread Neil Conway
Tom Lane wrote: A nonterminal that is not intended to represent any real input, ever, is just plain weird. If you say so... PL/PgSQL already uses such a beast, though: the lno nonterminal, for example. Not at all. The right way to do this, I think, is for the mid-rule action to palloc the

Re: [PATCHES] final light versions of Oracle compatibility (SQLSTATE, GREATEST,

2005-06-09 Thread Tom Lane
Neil Conway <[EMAIL PROTECTED]> writes: > Considering that the Bison manual suggests that it implements > mid-rule actions by introducing an implicit bogus non-terminal ([1]), Indeed ... and the reason that they bothered to do that is that mid-rule actions are more understandable ;-). A nontermi

Re: [PATCHES] final light versions of Oracle compatibility (SQLSTATE,

2005-06-09 Thread Neil Conway
Tom Lane wrote: Right, mid-rule actions were what I had in mind. They're not uglier than introducing empty nonterminals Well, IMHO they make the grammar rather hard to read when the action has multiple lines (we would need at least 6 lines of code in the mid-rule action, I believe). Unless w

Re: [PATCHES] final light versions of Oracle compatibility (SQLSTATE, GREATEST,

2005-06-09 Thread Tom Lane
Neil Conway <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> I still find the grammar changes to be an ugly kluge --- it should be >> possible to do this without introducing bogus nonterminals. > The scope-local variables need to be added to the namespace by the time > that we parse the WHEN clau

Re: [PATCHES] final light versions of Oracle compatibility (SQLSTATE,

2005-06-09 Thread Neil Conway
Tom Lane wrote: I still find the grammar changes to be an ugly kluge --- it should be possible to do this without introducing bogus nonterminals. The scope-local variables need to be added to the namespace by the time that we parse the WHEN clauses. I can see two ways to do that: adding a bog

Re: [PATCHES] final light versions of Oracle compatibility (SQLSTATE, GREATEST,

2005-06-09 Thread Tom Lane
Bruce Momjian writes: > Also, do we want these features? Do they duplicate anything we already > have? This patch only covers SQLSTATE/SQLERRM for plpgsql, which I think we're now agreed on doing. The other stuff is still open for discussion --- personally I'm OK with the concept of LEAST and G

Re: [PATCHES] final light versions of Oracle compatibility (SQLSTATE,

2005-06-09 Thread Bruce Momjian
Also, do we want these features? Do they duplicate anything we already have? --- Tom Lane wrote: > Neil Conway <[EMAIL PROTECTED]> writes: > > Attached is a revised version of this patch. I'll apply it tonight or > > tomor

Re: [PATCHES] final light versions of Oracle compatibility (SQLSTATE, GREATEST,

2005-06-09 Thread Tom Lane
Neil Conway <[EMAIL PROTECTED]> writes: > Attached is a revised version of this patch. I'll apply it tonight or > tomorrow, barring any objections. I still find the grammar changes to be an ugly kluge --- it should be possible to do this without introducing bogus nonterminals. The ns push/pop op

Re: [PATCHES] final light versions of Oracle compatibility (SQLSTATE, GREATEST,

2005-06-08 Thread Neil Conway
Pavel Stehule wrote: 1. SQLSTATE and SQLERRM exists only on exception's block, and allways carry info about some exception. Attached is a revised version of this patch. I'll apply it tonight or tomorrow, barring any objections. -Neil Index: doc/src/sgml/plpgsql.sgml =