Re: Default ordering option - Mailing list pgsql-general

From Cyril Champier
Subject Re: Default ordering option
Date
Msg-id CAJaA8Vf1t5b7RCf5y=cNQa-otundkXfsiXaN8vpZeVT-A+eRZw@mail.gmail.com
Whole thread Raw
In response to Re: Default ordering option  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-general
Peter:
So I would need to create a pg extension encapsulating this hook callback?
If this is the case, it seems it will be much more complicated than expected, and I wont be able to do it :(
But thanks for the suggestion anyway.

On Thu, Jul 25, 2019 at 12:21 PM Peter Eisentraut <peter.eisentraut@2ndquadrant.com> wrote:
On 2019-07-25 09:43, Cyril Champier wrote:
>     It might be an interesting exercise to implement this as a post-parsing
>     hook.
>
>  
> I known nothing about that, but that sounds interesting, do you have any
> documentation pointer to help me implement that?

Look for post_parse_analyze_hook.  Walk the parsed query tree, look for
queries without ordering clause and manufacture one.

--
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

pgsql-general by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Default ordering option
Next
From: Adrian Klaver
Date:
Subject: Re: Default ordering option