postgresql sequence nextval in schema February 21, 2023 by Tarik The quoting rules are painful. I think you want: SELECT nextval('foo."SQ_ID"'); to prevent case-folding of SQ_ID.