Sha256: 67547d2e83360248e620ebae3385d7c705316bf969912d14f8857d95af1796c5

Contents?: true

Size: 502 Bytes

Versions: 16

Compression:

Stored size: 502 Bytes

Contents

-- Doesn't work as currval is only defined if the current session has requested an ID from the sequence
select  n.nspname as "schema",
        c.relname as "table",
        last_value(pg_get_serial_sequence(n.nspname || '.' || c.relname, 'id'))
--        currval(pg_get_serial_sequence(n.nspname || '.' || c.relname, 'id'))
from    pg_class c
join    pg_namespace n on n.oid = c.relnamespace
where   n.nspname not like 'pg_%'
and     n.nspname <> 'information_schema'
and     c.relkind = 'r'
;      

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
postspec-0.5.5 snippets/serials.sql
postspec-0.5.4 snippets/serials.sql
postspec-0.5.3 snippets/serials.sql
postspec-0.5.2 snippets/serials.sql
postspec-0.5.1 snippets/serials.sql
postspec-0.5.0 snippets/serials.sql
postspec-0.4.1 snippets/serials.sql
postspec-0.4.0 snippets/serials.sql
postspec-0.2.5 snippets/serials.sql
postspec-0.2.4 snippets/serials.sql
postspec-0.2.3 snippets/serials.sql
postspec-0.2.2 snippets/serials.sql
postspec-0.2.1 snippets/serials.sql
postspec-0.2.0 snippets/serials.sql
postspec-0.1.2 snippets/serials.sql
postspec-0.1.1 snippets/serials.sql