Re: Autonomous Transaction is back
| От | Robert Haas |
|---|---|
| Тема | Re: Autonomous Transaction is back |
| Дата | |
| Msg-id | CA+TgmoZc-Z7wtL6Zvs+1Q+PVF+PKwwQkcazm2pVtbRPFNitQFw@mail.gmail.com обсуждение исходный текст |
| Ответ на | Re: Autonomous Transaction is back (Noah Misch <noah@leadboat.com>) |
| Ответы |
Re: Autonomous Transaction is back
|
| Список | pgsql-hackers |
On Sat, Aug 22, 2015 at 2:23 AM, Noah Misch <noah@leadboat.com> wrote:
>> > Can you get away with only looking at tuples though? For example,
>> > what about advisory locks? Table locks?
>>
>> Well, that's an interesting question. Can we get away with regarding
>> those things as non-conflicting, as between the parent and child
>> transactions?
>
> For system lock types, no. While one could define advisory locks to work
> differently, we should assume that today's advisory lockers have expectations
> like those of system lockers. An autonomous transaction should not bypass any
> lock that a transaction of another backend could not bypass.
Why?
Suppose you do this:
BEGIN;
DECLARE CURSOR foo FOR SELECT * FROM foo;
BEGIN AUTONOMOUS TRANSACTION;
ALTER TABLE foo ALTER bar TYPE int;
This has got to fail for safety reasons, but CheckTableNotInUse() is
on it. Suppose you do this:
BEGIN;
LOCK foo;
BEGIN AUTONOMOUS TRANSACTION;
INSERT INTO foo VALUES ('spelunk');
How will making this fail improve anything?
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
В списке pgsql-hackers по дате отправления: