Re: DELETE...RETURNING problem with libpq

From: Brice André <brice(at)famille-andre(dot)be>
To: Wolfe Whalen <wolfe(at)quios(dot)net>
Cc: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: DELETE...RETURNING problem with libpq
Date: 2013-05-25 12:49:38
Message-ID: CAOBG12ms=mgLFaR7BD7s7LckCtcT7dSYX2bUYd2A2wOGN8LaiQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi Wolfe,

First, thanks for your help.

I tried your code, but it does not work... the function returns a string :
"0". When I check, this command properly modifies one row, as expected.

I don't know if it may help, but just in case... The DELETE operation is
not performed on a table : it is performed on a view. I have a rule on that
view that, instead of performing a delete on the corresponding table,
performs an update with table entry tagged as deleted (in a dedicated
column of the table). This code (sql part) works for years and, when
executing this command by other ways (php and pgadmin), it deletes and
returns expected data. With libpq, it deletes, but does not return anything.

Regards,
Brice

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message JORGE MALDONADO 2013-05-25 17:17:20 Advice on re-writing a SELECT query.
Previous Message Wolfe Whalen 2013-05-25 12:00:41 Re: DELETE...RETURNING problem with libpq