Re: [HACKERS] Re: proposal - psql: possibility to specify sort fordescribe commands, when size is printed - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: [HACKERS] Re: proposal - psql: possibility to specify sort fordescribe commands, when size is printed
Date
Msg-id 20170310141645.GF9812@tamriel.snowman.net
Whole thread Raw
In response to Re: [HACKERS] Re: proposal - psql: possibility to specify sort fordescribe commands, when size is printed  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Responses Re: [HACKERS] Re: proposal - psql: possibility to specify sort fordescribe commands, when size is printed  (Alexander Korotkov <a.korotkov@postgrespro.ru>)
Re: [HACKERS] Re: proposal - psql: possibility to specify sort fordescribe commands, when size is printed  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
* Peter Eisentraut (peter.eisentraut@2ndquadrant.com) wrote:
> On 2/24/17 16:32, Pavel Stehule wrote:
> >     set EXTENDED_DESCRIBE_SORT size_desc
> >     \dt+
> >     \l+
> >     \di+
> >
> >     Possible variants: schema_table, table_schema, size_desc, size_asc
>
> I can see this being useful, but I think it needs to be organized a
> little better.
>
> Sort key and sort direction should be separate settings.
>
> I'm not sure why we need to have separate settings to sort by schema
> name and table name.  But if we do, then we should support that for all
> object types.  I think maybe that's something we shouldn't get into
> right now.
>
> So I would have one setting for sort key = {name|size} and on for sort
> direction = {asc|desc}.

Perhaps I'm trying to be overly cute here, but why not let the user
simply provide a bit of SQL to be put at the end of the query?

That is, something like:

\pset EXTENDED_DESCRIBE_ORDER_LIMIT 'ORDER BY 5 DESC LIMIT 10'

Thanks!

Stephen

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [HACKERS] Automatic cleanup of oldest WAL segments withpg_receivexlog
Next
From: Alexander Korotkov
Date:
Subject: Re: [HACKERS] Index usage for elem-contained-by-const-range clauses