postgresql sequence nextval in schema postgresql sequence nextval in schema postgresql postgresql

postgresql sequence nextval in schema


The quoting rules are painful. I think you want:

SELECT nextval('foo."SQ_ID"');

to prevent case-folding of SQ_ID.


SELECT last_value, increment_by from "other_schema".id_seq;

for adding a seq to a column where the schema is not public try this.

nextval('"other_schema".id_seq'::regclass)