"Mikhail V. Puzanov" <misha.puza...@gmail.com> writes: > -- increment and get the counter if exists > UPDATE sequences SET counter = counter + 1 > WHERE section = 'testSection' AND name = 'testKey' > RETURNING counter;
Seems that what you have here is a bad manual implementation of a sequence. Why don't you use a real sequence object and nextval()? regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql