Waiting for PostgreSQL 10 – Add pg_sequence system catalog

On 20th of December, Peter Eisentraut committed patch:

Add pg_sequence system catalog
 
Move sequence metadata (start, increment, etc.) into a proper system
catalog instead of storing it in the sequence heap object.  This
separates the metadata from the sequence data.  Sequence metadata is now
operated on transactionally by DDL commands, whereas previously
rollbacks of sequence-related DDL commands would be ignored.
 
Reviewed-by: Andreas Karlsson

Continue reading Waiting for PostgreSQL 10 – Add pg_sequence system catalog

getting multiple values from sequences

there are this situations where you need (or you think you need) to get multiple values from sequence.

for example – you're importing lots of data: some objects, some objects which relate to base objects, and so on.

of course you can do it all with simple inserts, and currval, but it would be rather slow:

Continue reading getting multiple values from sequences