Christopher B. Browne's Home Page
cbbrowne@acm.org

8.94. sequencelastvalue(text)

Function Properties

PLPGSQLbigint
sequenceLastValue(p_seqname) Utility function used in sl_seqlastvalue view to compactly get the last value from the requested sequence.
    declare
    	p_seqname	alias for $1;
    	v_seq_row	record;
    begin
    	for v_seq_row in execute 'select last_value from ' || slon_quote_input(p_seqname)
    	loop
    		return v_seq_row.last_value;
    	end loop;
    
    	-- not reached
    end;

Google

If this was useful, let others know by an Affero rating

Contact me at cbbrowne@acm.org