Re: Modifying SQL parser with extensions?

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Modifying SQL parser with extensions?
Дата
Msg-id 20061029204103.GC4665@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: Modifying SQL parser with extensions?  (Matthias Luedtke <matthias-luedtke@gmx.de>)
Ответы Re: Modifying SQL parser with extensions?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Matthias Luedtke wrote:
>
> 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]

Hummm, doesn't this sound suspiciously close to the "skyline" algorithm
type stuff?  AFAIU skyline allowed you to specify conditions and weights
for each one, and redefined ORDER BY to work following those.  In that
case, I may as well point out that there's a couple of gals working on
this.  They hang out on the pgsql-es-ayuda list (in spanish).  They have
the grammar part working, at least.

I think this particular example could be made work by using CASE
constructs.  I'm not sure how efficient or cumbersome that would turn
out to be.  (That particular notation has the drawback that the [n]
would be interpreted as an array index though.)

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

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

Предыдущее
От: "Dawid Kuroczko"
Дата:
Сообщение: Re: Modifying SQL parser with extensions?
Следующее
От: "Dawid Kuroczko"
Дата:
Сообщение: Re: Wordpress & PostgreSQL ...