ERROR: cannot execute nextval() in a read-only transaction - Mailing list pgsql-general

From Dae-man Yang
Subject ERROR: cannot execute nextval() in a read-only transaction
Date
Msg-id BANLkTik9ikVUU-bznOhZHmLbdEx5fverCw@mail.gmail.com
Whole thread Raw
Responses Re: ERROR: cannot execute nextval() in a read-only transaction  (Craig Ringer <craig@postnewspapers.com.au>)
List pgsql-general
I upgrade postgresql from 8.4.2 to 9.0.4.
But I have one problem.
The Error message 'cannot execute nextval() in a read-only transaction'

Please help me.


[Version 8.4.2]
DEVDB=# select version();
                                                      version

-------------------------------------------------------------------------------------------------------------------
 PostgreSQL 8.4.2 on x86_64-unknown-linux-gnu, compiled by GCC gcc
(GCC) 3.4.6 20060404 (Red Hat 3.4.6-10), 64-bit
(1 row)

DEVDB=# select version();
                                                      version
-------------------------------------------------------------------------------------------------------------------
 PostgreSQL 8.4.2 on x86_64-unknown-linux-gnu, compiled by GCC gcc
(GCC) 3.4.6 20060404 (Red Hat 3.4.6-10), 64-bit
(1 row)

DEVDB=# SET SESSION CHARACTERISTICS AS TRANSACTION READ ONLY;
SET
DEVDB=#  select nextval('ws_blog_sns_inf_sns_inf_master_seq_seq');
 nextval
---------
       5
(1 row)

DEVDB=# SHOW transaction_read_only;
 transaction_read_only
-----------------------
 on
(1 row)

[Version 9.0.4]

web_dev=# select version();
                                                      version
-------------------------------------------------------------------------------------------------------------------
 PostgreSQL 9.0.4 on x86_64-unknown-linux-gnu, compiled by GCC gcc
(GCC) 4.1.2 20080704 (Red Hat 4.1.2-46), 64-bit
(1 row)

web_dev=# SET SESSION CHARACTERISTICS AS TRANSACTION READ ONLY;
SET
web_dev=# SHOW transaction_read_only;
 transaction_read_only
-----------------------
 on
(1 row)

web_dev=#  select nextval('ws_blog_sns_inf_sns_inf_master_seq_seq');
ERROR:  cannot execute nextval() in a read-only transaction

pgsql-general by date:

Previous
From: mephysto
Date:
Subject: Custom types and JDBC
Next
From: Stanislav Raskin
Date:
Subject: full text search to_tsquery performance with ispell dictionary