pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
postgresql 7.3 php transaction problem
2+ messages / 2 participants
[nested] [flat]

* postgresql 7.3 php transaction problem
@ 2006-02-26 02:51 enediel gonzalez <enediel@hotmail.com>
  2006-02-26 05:33 ` Re: postgresql 7.3 php transaction problem chris smith <dmagick@gmail.com>
  0 siblings, 1 reply; 2+ messages in thread

From: enediel gonzalez @ 2006-02-26 02:51 UTC (permalink / raw)
  To: pgsql-php

Hello

I need a complex transaction that should update some database tables.

The updated tables  inside the transaction should be used also to find 
information during the transaction process.

BEGIN (I created the transaction)

First iteration
i(0)
I created a record into the 'products_inventory' table (sucess)

Second iteration
i(1)

select pk from products_inventory where (nu_product = 4) and (serial_number 
= '9087') and (quantity > 0)
Warning: pg_query(): Query failed: ERROR: current transaction is aborted, 
commands ignored until end of transaction block

this query fails on the second iteration (the query is sintactically 
correct.


I tried to create a whole batch to lauch the transaction completelly in the 
following form

BEGIN;
statement;
statement;
statement;
...
COMMIT;

launching the script from the php page fails, but taking the same script and 
using phppgadmin, the same script sucess.

Another question about transactions in postgresql
?Is it possible inside the transaction to see the changes ocurred into the 
database ,resulting of the previous statements executed on the same 
transaction?

Thanks in advance for any help or explanation

Regards
Enediel





^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: postgresql 7.3 php transaction problem
  2006-02-26 02:51 postgresql 7.3 php transaction problem enediel gonzalez <enediel@hotmail.com>
@ 2006-02-26 05:33 ` chris smith <dmagick@gmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: chris smith @ 2006-02-26 05:33 UTC (permalink / raw)
  To: enediel gonzalez <enediel@hotmail.com>; +Cc: pgsql-php

> launching the script from the php page fails, but taking the same script and
> using phppgadmin, the same script sucess.

Then they're probably not the same. Enable logging on your postgresql
server and see the exact queries that are being run when you use the
php script.

> Another question about transactions in postgresql
> ?Is it possible inside the transaction to see the changes ocurred into the
> database ,resulting of the previous statements executed on the same
> transaction?

Any statements executed INSIDE a transaction are visible.

To another outside transaction, nothing is visible.



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2006-02-26 05:33 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-02-26 02:51 postgresql 7.3 php transaction problem enediel gonzalez <enediel@hotmail.com>
2006-02-26 05:33 ` chris smith <dmagick@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox