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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: final light versions of Oracle compatibility (SQLSTATE, GREATEST,
Дата
Msg-id 18081.1118379274@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: final light versions of Oracle compatibility (SQLSTATE,  (Neil Conway <neilc@samurai.com>)
Ответы Re: final light versions of Oracle compatibility (SQLSTATE,  (Neil Conway <neilc@samurai.com>)
Список pgsql-patches
Neil Conway <neilc@samurai.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

В списке pgsql-patches по дате отправления:

Предыдущее
От: Neil Conway
Дата:
Сообщение: Re: final light versions of Oracle compatibility (SQLSTATE,
Следующее
От: Volkan YAZICI
Дата:
Сообщение: PQmakeEmptyPGresult() will return NULL if allocation fails