[Postgres-xl-developers] Question about currval

Gustavo Rincon gustavo.rincon at ymail.com
Wed Aug 3 08:35:32 PDT 2016


Hi,                 I’m trying to retrieve the sequence id assigned to a row after inserting using SELECT currval statement, but the following error is returned: ERROR:  currval of sequence "content_type_seq" is not yet defined in this session                  Does the postgres-xl does not support any more currval after insertion or maybe my cluster is not configured correctly? Query used to get the error message -- CREATE SEQUENCE content_type_seq START WITH 1; -- CREATE TABLE IF NOT EXISTS content_type (--   id int NOT NULL default nextval('content_type_seq'),--   name varchar(255) NOT NULL,--   CONSTRAINT content_type_pk PRIMARY KEY (id)-- ) DISTRIBUTE BY REPLICATION; -- ALTER SEQUENCE content_type_seq OWNED BY content_type.id; BEGIN;INSERT into content_type (name) values ('image/jpeg');SELECT currval('content_type_seq');COMMIT; Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.postgres-xl.org/private.cgi/postgres-xl-developers-postgres-xl.org/attachments/20160803/6e4ca690/attachment.htm>


More information about the Postgres-xl-developers mailing list