| From: | Andres Freund <andres(at)2ndquadrant(dot)com> |
|---|---|
| To: | Heikki Linnakangas <hlinnakangas(at)vmware(dot)com> |
| Cc: | Josh Berkus <josh(at)agliodbs(dot)com>, Kevin Grittner <kgrittn(at)ymail(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: [PATCH] SQL assertions prototype |
| Date: | 2013-12-18 11:39:11 |
| Message-ID: | 20131218113911.GC5224@alap2.anarazel.de |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On 2013-12-18 13:07:51 +0200, Heikki Linnakangas wrote:
> Here's another idea that doesn't involve SSI:
>
> At COMMIT, take a new snapshot and check that the assertion still passes
> with that snapshot. Now, there's a race condition, if another transaction is
> committing at the same time, and performs the same check concurrently. That
> race condition can be eliminated by holding an exclusive lock while running
> the assertion, until commit, effectively allowing the assertion to be
> checked by only one transaction at a time.
>
> I think that would work, and would be simple, although it wouldn't scale too
> well.
It probably would also be very prone to deadlocks.
Greetings,
Andres Freund
--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Ashutosh Bapat | 2013-12-18 11:42:09 | Re: Example query causing param_info to be set in plain rel path |
| Previous Message | Heikki Linnakangas | 2013-12-18 11:07:51 | Re: [PATCH] SQL assertions prototype |