Re: BETWEEN SYMMETRIC/ASYMMETRIC

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BETWEEN SYMMETRIC/ASYMMETRIC
Дата
Msg-id 26593.1018494560@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BETWEEN SYMMETRIC/ASYMMETRIC  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
Ответы Make text output more generic  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
Список pgsql-hackers
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:
> Since it's really just two ways of writing the same thing, wouldn't bison
> just produce the exact same C code?  I'll rewrite it anyway for elegance,
> but just wondering...

The emitted code might or might not be the same --- but duplicate or
near-duplicate chunks of source code are always best avoided, if only
from a maintenance perspective.

>> BTW, I've forgotten whether your patch is purely syntactic or not,
>> but I'd really like to see someone fix things so that BETWEEN has its
>> own expression node tree type and is not expanded into some ugly
>> "A>=B and A<=C" equivalent.  This would (a) allow it to be
>> reverse-listed reasonably, and (b) eliminate redundant evaluations of
>> the subexpressions.

> It is purely syntactic.  Anyone want to give me a quick hint on how to make
> a new node tree type for BETWEEN?

Try chasing the references to another extant expression node type,
perhaps NullTest.  It's fairly straightforward, but tedious to teach
all the relevant places about it.

> What does reverse-listing mean as well?

reverse-listing is what src/backend/utils/adt/ruleutils.c does: produce
something readable from an internal node tree.  \d for a view, pg_dump,
and other useful things depend on this.
        regards, tom lane


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

Предыдущее
От: Neil Conway
Дата:
Сообщение: Re: help with bison
Следующее
От: "Christopher Kings-Lynne"
Дата:
Сообщение: Re: help with bison