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

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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: Pavel Stehule <stehule(at)kix(dot)fsv(dot)cvut(dot)cz>,pgsql-patches(at)postgresql(dot)org, pgman(at)candle(dot)pha(dot)pa(dot)us
Subject: Re: final light versions of Oracle compatibility (SQLSTATE, GREATEST,
Date: 2005-06-10 04:54:34
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches
Neil Conway <neilc(at)samurai(dot)com> 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 nonterminal that is not intended
to represent any real input, ever, is just plain weird.

> Unless we want two contiguous mid-rule actions 
> (which is even _less_ readable), we'll need to futz with adding another 
> member to %union to hold the two varnos the mid-rule action will 
> produce.

Not at all.  The right way to do this, I think, is for the mid-rule
action to palloc the PLpgSQL_exception_block, fill the variables into
that, and return the block as its semantic value.  The end-of-rule
action then picks up the block and adds what it needs to.

One reason this is cleaner is that it scales to more SQLERRx variables
without further renumbering of the rule components.

			regards, tom lane

In response to


pgsql-patches by date

Next:From: Volkan YAZICIDate: 2005-06-10 07:34:29
Subject: PQmakeEmptyPGresult() will return NULL if allocation fails
Previous:From: Neil ConwayDate: 2005-06-10 04:24:33
Subject: Re: final light versions of Oracle compatibility (SQLSTATE,

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