Hello Guillaume,
Thanks for your answer.
Your example is working fine on my computer too (I had to adapt some includes because my client is under Windows, but everything else was fine...).
But, this example is slightly different from my real code : in your example, the delete on the rule really deletes the element. In my code, the delete on the rule tags the element as deleted (with an UPDATE statement and a dedicated column in t1 table).
I slightly changed your example to be more representative of my code. Here are my results :
- When executing the SQL statement from pgadmin, I get my 81 columns marked as deleted and I get the 81 row results to the query.
- Whe executing it from your script, the function PQexecPrepared does not return 'PGRES_TUPLES_OK' anymore. It now returns 'PGRES_COMMAND_OK'.
- From your program, the 81 rows are marked as deleted, as expected.
- From your program, PQntuples returns the "0" string.
- I did not try from php, but I expect same behaviour as with my real program...
So, once modified, this example behaves like my program.
I suppose that php and pgadmin use the same interface to execute the query. So, I suppose that there should be a solution to my problem... Do you think it's a bug in my version of libpq ? Or maybe is it related to the fact that I use prepared statement ?
I joined my little test program to this e-mail.
Thanks in advance,
Brice