error on INSERT - connection is read only - Mailing list pgsql-hackers

From Nisha Srinivasan
Subject error on INSERT - connection is read only
Date
Msg-id IMECIOAJKHNEDBJNAIDDGELOCEAA.nisha@arch.sel.sony.com
Whole thread Raw
List pgsql-hackers
Hi,

l see that a lot of people have the same problem and have posted questions
but I couldn't find an answer on the web.

I have Postgresql 6.5.3 running on Debian Linux.
And I use the iODBC driver manager 2.50.3 to make the ODBC calls.

Am not able to insert data into Postgres tables across ODBC.
I can do it using psql though.

odbc.ini has an entry saying readonly = no.
Also from the C++ program, I set the attribute of connection object as
writable explicitly.
If I ping the the connection object it says it's a writable connection.
And immediately i have a
connection.prepareStatement()
call that does an INSERT.
When this line is executed I get an error saying
"Connection is readonly, only select statements are allowed."

This error msg comes WITHOUT the [ODBC] tag.

Again when I catch{}  the exception, I ping the connection object.
It's still a writable connection.

I should also mention that I use FreeODBC++ wrapper.
But I've searched through their source code and such an error message is not
defined in .h or .cpp files

I have tried to connect using the postgres superuser as well.
I have also tried to change my 'pg_hba.conf' file to allow connection as
trust for all.
This table has a primary key and permisions GRANTed to public for all
operations.

Apprecitate your help.

Thanx,
Nisha

Attachment

pgsql-hackers by date:

Previous
From: teg@redhat.com (Trond Eivind Glomsrød)
Date:
Subject: Re: Configurable path to look up dynamic libraries
Next
From: Nils Zonneveld
Date:
Subject: Re: Queries across multiple databases (was: SELECT from a table in another database).