1.11. View: sl_seqlastvalue

Structure of sl_seqlastvalue

seq_id

integer

seq_set

integer

seq_reloid

oid

seq_origin

integer

seq_last_value

bigint

Figure 1-1. Definition of view sl_seqlastvalue

SELECT sq.seq_id
, sq.seq_set
, sq.seq_reloid
, s.set_origin AS seq_origin
, sequencelastvalue
(
     (
           (quote_ident
                 (
                       (pgn.nspname)::text
                 ) || '.'::text
           ) || quote_ident
           (
                 (pgc.relname)::text
           )
     )
) AS seq_last_value 
FROM sl_sequence sq
, sl_set s
, pg_class pgc
, pg_namespace pgn 
WHERE (
     (
           (s.set_id = sq.seq_set)
         AND (pgc.oid = sq.seq_reloid)
     )
   AND (pgn.oid = pgc.relnamespace)
);