Re: Modifying SQL parser with extensions? - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: Modifying SQL parser with extensions?
Date
Msg-id 20061029204103.GC4665@alvh.no-ip.org
Whole thread Raw
In response to Re: Modifying SQL parser with extensions?  (Matthias Luedtke <matthias-luedtke@gmx.de>)
Responses Re: Modifying SQL parser with extensions?
List 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 by date:

Previous
From: "Dawid Kuroczko"
Date:
Subject: Re: Modifying SQL parser with extensions?
Next
From: "Dawid Kuroczko"
Date:
Subject: Re: Wordpress & PostgreSQL ...