[COMMITTERS] pgsql: psql: Update \d sequence display - Mailing list pgsql-committers

From Peter Eisentraut
Subject [COMMITTERS] pgsql: psql: Update \d sequence display
Date
Msg-id E1dxzKK-00074m-Ua@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
psql: Update \d sequence display

For \d sequencename, the psql code just did SELECT * FROM sequencename
to get the information to display, but this does not contain much
interesting information anymore in PostgreSQL 10, because the metadata
has been moved to a separate system catalog.

This patch creates a newly designed sequence display that is not merely
an extension of the general relation/table display as it was previously.

Example:

PostgreSQL 9.6:

=> \d foobar          Sequence "public.foobar"   Column     |  Type   |        Value
---------------+---------+---------------------sequence_name | name    | foobarlast_value    | bigint  | 1start_value
|bigint  | 1increment_by  | bigint  | 1max_value     | bigint  | 9223372036854775807min_value     | bigint  |
1cache_value  | bigint  | 1log_cnt       | bigint  | 0is_cycled     | boolean | fis_called     | boolean | f 

PostgreSQL 10 before this change:

=> \d foobar  Sequence "public.foobar"  Column   |  Type   | Value
------------+---------+-------last_value | bigint  | 1log_cnt    | bigint  | 0is_called  | boolean | f

New:

=> \d foobar                          Sequence "public.foobar" Type  | Start | Minimum |       Maximum       |
Increment| Cycles? | Cache 
--------+-------+---------+---------------------+-----------+---------+-------bigint |     1 |       1 |
9223372036854775807|         1 | no      |     1 

Reviewed-by: Fabien COELHO <coelho@cri.ensmp.fr>

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5cc5987cedd8c60c738135abcb25df5247db7d1e

Modified Files
--------------
src/bin/psql/describe.c                | 189 +++++++++++++++++++--------------
src/test/regress/expected/identity.out |   7 ++
src/test/regress/expected/sequence.out |  13 +++
src/test/regress/sql/identity.sql      |   2 +
src/test/regress/sql/sequence.sql      |   4 +
5 files changed, 135 insertions(+), 80 deletions(-)


--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: [COMMITTERS] pgsql: Marginal improvement for generated code in execExprInterp.c.
Next
From: Robert Haas
Date:
Subject: [COMMITTERS] pgsql: pgbench: If we fail to send a command to the server, fail.