Re: Modifying SQL parser with extensions?

Поиск
Список
Период
Сортировка
От Matthias Luedtke
Тема Re: Modifying SQL parser with extensions?
Дата
Msg-id 4544FFA0.1010306@gmx.de
обсуждение исходный текст
Ответ на Re: Modifying SQL parser with extensions?  (Alvaro Herrera <alvherre@commandprompt.com>)
Ответы Re: Modifying SQL parser with extensions?  ("Dawid Kuroczko" <qnex42@gmail.com>)
Re: Modifying SQL parser with extensions?  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-general
Alvaro Herrera wrote:
>> In fact, parsing this SQL dialect would just be the first step, as the
>> annotations within the query induce an ordering of the result set.
>
> Huh, what is this supposed to be able to do that you can't do with the
> already existing ORDER BY clause?

Basically, conditional statements are annotated with integers that
represent weights, like

(...)WHERE (foo = 'a')[42] OR (bar = 'b')[20]

In the result set those entries that fulfill both conditions yield score
62, i.e. 42+20, and are ranked top, whereas entries that fulfill only
one of the conditions yield scores 42 and 20 respectively and are
therefore ranked lower.

Honestly, I'm only the poor student who has to implement what the
smarter ones have thought out. ;)

And, yes, it is possible to accomplish the desired sorting with the
ORDER BY clause, but as conditions become more complex, the self cooked
dialect is considered to be more readable and intuitive to the end user.

Regards,
Matthias

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Modifying SQL parser with extensions?
Следующее
От: Matthias Luedtke
Дата:
Сообщение: Re: Modifying SQL parser with extensions?