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

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: Dae-man Yang <yangsclub(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: ERROR: cannot execute nextval() in a read-only transaction
Date: 2011-05-12 02:48:12
Message-ID: 4DCB4A6C.2040001@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 05/11/2011 02:29 PM, Dae-man Yang wrote:
> 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.

nextval() modifies a sequence, so you shouldn't be doing it in a
read-only transaction. Pg 9.0.4 enforces this, but it was still a bug in
whatever was trying to use nextval() in a read-only transaction before
9.0, Pg just didn't notice and warn you.

--
Craig Ringer

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2011-05-12 02:52:24 Re: invalid byte sequence for encoding "UTF8": 0xf1612220
Previous Message Joshua Tolley 2011-05-12 01:12:43 Re: Debug Contrib/cube code