Re: libpq doing strange things

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: libpq doing strange things
Дата
Msg-id 15369.1010449962@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: libpq doing strange things  (Daniel Andersen <zedar@free2air.com.au>)
Список pgsql-interfaces
Daniel Andersen <zedar@free2air.com.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
transaction.

> 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


В списке pgsql-interfaces по дате отправления:

Предыдущее
От: Daniel Andersen
Дата:
Сообщение: Re: libpq doing strange things
Следующее
От: Tim Nelson
Дата:
Сообщение: [ECPG] generates bad code on declare/open