From 67dc4ccbb2e1c27da823eced66d9217a5652cbb0 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Fri, 18 Nov 2016 12:00:00 -0500 Subject: Add pg_sequences view Like pg_tables, pg_views, and others, this view contains information about sequences in a way that is independent of the system catalog layout but more comprehensive than the information schema. To help implement the view, add a new internal function pg_sequence_last_value() to return the last value of a sequence. This is kept separate from pg_sequence_parameters() to separate querying run-time state from catalog-like information. Reviewed-by: Andreas Karlsson --- doc/src/sgml/catalogs.sgml | 97 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) (limited to 'doc/src') diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml index bac169a19e4..561e228558d 100644 --- a/doc/src/sgml/catalogs.sgml +++ b/doc/src/sgml/catalogs.sgml @@ -7394,6 +7394,11 @@ security labels + + pg_sequences + sequences + + pg_settings parameter settings @@ -9135,6 +9140,98 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx + + <structname>pg_sequences</structname> + + + pg_sequences + + + + The view pg_sequences provides access to + useful information about each sequence in the database. + + + + <structname>pg_sequences</> Columns + + + + + Name + Type + References + Description + + + + + schemaname + name + pg_namespace.nspname + Name of schema containing sequence + + + sequencename + name + pg_class.relname + Name of sequence + + + sequenceowner + name + pg_authid.rolname + Name of sequence's owner + + + start_value + bigint + + Start value of the sequence + + + min_value + bigint + + Minimum value of the sequence + + + max_value + bigint + + Maximum value of the sequence + + + increment_by + bigint + + Increment value of the sequence + + + cycle + boolean + + Whether the sequence cycles + + + cache_size + bigint + + Cache size of the sequence + + + last_value + bigint + + The last sequence value written to disk. If caching is used, + this value can be greater than the last value handed out from the + sequence. Null if the sequence has not been read from yet. + + + +
+
+ <structname>pg_settings</structname> -- cgit v1.2.3