Add pg_sequences view
Peter Eisentraut <peter_e@gmx.net>
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 <andreas@proxel.se>
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/catalogs.sgml | modified | +97 −0 |
| src/backend/catalog/system_views.sql | modified | +17 −0 |
| src/backend/commands/sequence.c | modified | +46 −3 |
| src/include/catalog/catversion.h | modified | +1 −1 |
| src/include/catalog/pg_proc.h | modified | +3 −1 |
| src/include/commands/sequence.h | modified | +1 −0 |
| src/test/regress/expected/rules.out | modified | +14 −0 |
| src/test/regress/expected/sequence_1.out | modified | +21 −2 |
| src/test/regress/expected/sequence.out | modified | +21 −2 |
| src/test/regress/sql/sequence.sql | modified | +12 −1 |