Hello,
I have recently discovered a rather nasty problem with PhP and Postgres:
Our app executes fairly large batches of SQL insert queries (~600 lines) in form of transaction. Part of those queries are currval() subselects on "serial" values within tables, inserted earlier in the same transaction.
This works like a charm when a single insert is performed, but as soon as we initialize several processes (from different browser windows on same machine), the subselects begin to mix up values between each other, which leads to real bad-a$$ integrity mess.
AFAIK Postgresql pays attention to avoid race conditions with currval queries by making sure that they are always unique within a session (http://www.postgresql.org/docs/faqs.FAQ.html#4.11.2) but as it seems this is not the case when queries are run under PhP.
This leads to question: Does PhP share one DB session for multiple, simultanious web requests? If yes, how can I disable that?
Cheers
Select*
P.s.
PhP v4.3.3 (Yep, I know I should upgrade)
Postgres v7.3.2