ERROR: cannot execute nextval() in a read-only transaction

From: Dae-man Yang <yangsclub(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: ERROR: cannot execute nextval() in a read-only transaction
Date: 2011-05-11 06:29:07
Message-ID: BANLkTik9ikVUU-bznOhZHmLbdEx5fverCw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message AI Rumman 2011-05-11 07:16:30 invalid byte sequence for encoding "UTF8": 0xf1612220
Previous Message Thomas Kellerer 2011-05-11 06:17:31 Documentation suggestion