
BEGIN
    EXECUTE 'SELECT last_value , seqincrement , seqmax , seqmin , seqcache , decode(seqcycle, FALSE, ''N'', TRUE, ''Y'') , ''Y'' FROM ' || seqoid::regclass::text || ', pg_sequence WHERE seqrelid = ' || seqoid INTO LAST_NUMBER, INCREMENT_BY, MAX_VALUE, MIN_VALUE, CACHE_SIZE, CYCLE_FLAG, ORDER_FLAG;
END;
