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

From Tom Lane
Subject Re: Modifying SQL parser with extensions?
Date
Msg-id 28814.1162144196@sss.pgh.pa.us
Whole thread Raw
In response to Re: Modifying SQL parser with extensions?  (Matthias Lüdtke <matthias-luedtke@gmx.de>)
Responses Re: Modifying SQL parser with extensions?  (Matthias Luedtke <matthias-luedtke@gmx.de>)
List pgsql-general
=?ISO-8859-1?Q?Matthias_L=FCdtke?= <matthias-luedtke@gmx.de> writes:
> 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.
> So I need this extra information in the query to accomplish the
> subsequent task of sorting the result set in a certain way before the
> result is returned to the client. I'll have to use some hand crafted
> internal data structures to do this sorting.

Seems like you could save a large amount of work if you can express what
you want to do as ORDER BY a user-defined operator.

If you insist on bolting it on as new SQL syntax, changing the parser
will be only the tip of the iceberg --- you'll likely need planner and
executor changes as well.  You could get a rough idea of what's involved
in adding a new kind of query clause by looking at the last patch that
did so:
http://archives.postgresql.org/pgsql-committers/2006-08/msg00251.php

            regards, tom lane

pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Modifying SQL parser with extensions?
Next
From: Matthias Luedtke
Date:
Subject: Re: Modifying SQL parser with extensions?