Skip site navigation (1) Skip section navigation (2)

Re: libpq doing strange things

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Daniel Andersen <zedar(at)free2air(dot)com(dot)au>
Cc: Postgres Interface List <pgsql-interfaces(at)postgresql(dot)org>
Subject: Re: libpq doing strange things
Date: 2002-01-08 00:32:42
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces
Daniel Andersen <zedar(at)free2air(dot)com(dot)au> writes:
> Hrm i probably should have fixed up that earlier mistake in my code before 
> copying and pasting. The pgres_tuples_ok thing is irrelevant,the printed 
> results show pgres_command_ok is being returned, so as i said things should 
> theoretically be ok. But they aren't. The query is not being executed 
> correctly as the database is remaining unmodified, despite the query saying 
> it has updated one row (the expected result).

If the backend says it updated one row, then I'm reasonably confident
that it updated one row.  I'll bet your problem is that you're not
committing the transaction (eg, you issued BEGIN but no COMMIT).
In that case, the updated row never becomes visible outside your own

> If i copy the query word for 
> word into the psql database interface, it is executed perfectly and update 
> the one record as it should.

This pretty much exonerates both the backend and libpq, seeing as how
psql is just an application built on top of libpq.  Time to start
looking at your own application logic.

			regards, tom lane

In response to

pgsql-interfaces by date

Next:From: David JoynerDate: 2002-01-09 14:01:33
Subject: libpq++
Previous:From: Daniel AndersenDate: 2002-01-07 23:44:21
Subject: Re: libpq doing strange things

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group