On 9 May 2018 at 18:24, Steve Baldwin <steve.baldwin@gmail.com> wrote:
> bcaas=> explain analyze select id from log_statement where id = (select currval('log_statement_id_seq'));
I know Tom has answered your question, but you may be interested in
INSERT RETURNING as this will save you from having to do this to
lookup the ID of the last inserted sequence value.
https://www.postgresql.org/docs/10/static/sql-insert.html
--
David Rowley http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services