Re: [PATCHES] Proposed patch for LISTEN/NOTIFY race condition

2008-03-12 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes:
> Tom Lane wrote:
>> The patch disallows LISTEN/NOTIFY in a prepared transaction, and there
>> is also a side effect on whether a transaction can see entries in
>> pg_listener for its own uncommitted LISTEN commands.

> I wonder if it would've been easier to make NOTIFY use SnapshotDirty to
> examine pg_listener, thus causing it to see the uncommitted rows.  Would
> that work at all?

I don't think so.  NOTIFY has to update the rows, not only see them,
and you can't update someone else's uncommitted row.  In any case we'd
be venturing into uncharted territory, which isn't something I'd want
to backpatch.  The existing patch is just altering the timing of the
same actions we take already, so it seems a lot safer.  IMHO anyway.

regards, tom lane

-- 
Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches


Re: [PATCHES] Proposed patch for LISTEN/NOTIFY race condition

2008-03-12 Thread Alvaro Herrera
Tom Lane wrote:

> The patch disallows LISTEN/NOTIFY in a prepared transaction, and there
> is also a side effect on whether a transaction can see entries in
> pg_listener for its own uncommitted LISTEN commands.

I wonder if it would've been easier to make NOTIFY use SnapshotDirty to
examine pg_listener, thus causing it to see the uncommitted rows.  Would
that work at all?

-- 
Alvaro Herrerahttp://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

-- 
Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches


Re: [PATCHES] Proposed patch for LISTEN/NOTIFY race condition

2008-03-11 Thread Tom Lane
I wrote:
> The patch disallows LISTEN/NOTIFY in a prepared transaction,

I meant LISTEN/UNLISTEN, of course.  See pghackers discussion here:
http://archives.postgresql.org/pgsql-hackers/2008-03/msg00290.php

regards, tom lane

-- 
Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches