Re: transaction is read-only error

From: Josh Kupershmidt <schmiddy(at)gmail(dot)com>
To: Salil Wadnerkar <rohshall(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: transaction is read-only error
Date: 2010-09-17 15:57:39
Message-ID: AANLkTin+d-aO6PxBJjZrqs5=Tcw6VQN0qdjpBJQXf5eo@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Fri, Sep 17, 2010 at 6:14 AM, Salil Wadnerkar <rohshall(at)gmail(dot)com> wrote:
> Hi Josh,
>
> Thanks for replying. I tried the "set transaction" command. I still
> get the "transaction is read-only" error when I issue the "insert
> into" command.
> If there is no other solution, how do I set the value of the variable
> "default_transaction_read_only" to false from the admin console?

How about trying this using the psql client to connect to your database:

BEGIN;
SET TRANSACTION READ WRITE;
-- try your insert statement here
COMMIT;

As for permanently turning off default_transaction_read_only, you can
do it either with an ALTER DATABASE or by editing postgresql.conf,
setting default_transaction_read_only = off, and restarting or
reloading the server. You said the ALTER DATABASE didn't work before,
but maybe that was because you tried the ALTER DATABASE inside a
transaction? Either way.. if you're still having problems, use psql
directly and post exactly what you entered and what error
messages/other output you see.

Use these commands:
SHOW default_transaction_read_only;
SELECT name, setting, context, source FROM pg_settings WHERE name =
'default_transaction_read_only';

to help troubleshoot further.

Josh

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Salil Wadnerkar 2010-09-20 10:33:51 Re: transaction is read-only error
Previous Message Mladen Gogala 2010-09-17 15:19:22 Re: Unable to use VIEWS (Ok button remains shaded)