From: | "Jaime Casanova" <systemguards(at)gmail(dot)com> |
---|---|
To: | "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | "Dennis Bjorklund" <db(at)zigo(dot)dhs(dot)org>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: BEGIN inside transaction should be an error |
Date: | 2006-05-10 06:25:36 |
Message-ID: | c2d9e70e0605092325g125f575bsb870513681d97ee8@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers pgsql-patches |
On 5/10/06, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org> writes:
> > Yesterday I helped a guy on irc with a locking problem, he thought
> > that locking in postgresql was broken. It turned out that he had a PHP
> > function that he called inside his transaction and the function did BEGIN
> > and COMMIT. Since BEGIN inside a transaction is just a warning what
> > happend was that the inner COMMIT ended the transaction and
> > released the locks. The rest of his commands ran with autocommit
> > and no locks and he got broken data into the database.
>
> > Could we make BEGIN fail when we already are in a transaction?
>
> We could, but it'd probably break about as many apps as it fixed.
> I wonder whether php shouldn't be complaining about this, instead
> --- doesn't php have its own ideas about controlling where the
> transaction commit points are?
>
> regards, tom lane
>
AFAIK php doesn't care about that... it just see for success or
failure conditions, so if postgres said everything is ok it will
continue...
--
Atentamente,
Jaime Casanova
"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs and the universe trying
to produce bigger and better idiots.
So far, the universe is winning."
Richard Cook
From | Date | Subject | |
---|---|---|---|
Next Message | Christopher Kings-Lynne | 2006-05-10 06:26:52 | Re: BEGIN inside transaction should be an error |
Previous Message | Lukas Smith | 2006-05-10 06:25:24 | Re: BEGIN inside transaction should be an error |
From | Date | Subject | |
---|---|---|---|
Next Message | Christopher Kings-Lynne | 2006-05-10 06:26:52 | Re: BEGIN inside transaction should be an error |
Previous Message | Lukas Smith | 2006-05-10 06:25:24 | Re: BEGIN inside transaction should be an error |