Re: LISTEN vs. two-phase commit

From: Mark Mielke <mark(at)mark(dot)mielke(dot)cc>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: LISTEN vs. two-phase commit
Date: 2008-03-11 01:54:15
Message-ID: 47D5E647.8080308@mark.mielke.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Does it make any sense to allow LISTEN or UNLISTEN in a prepared
> transaction?
> ...
>
> Comments?
>

Assuming I understand your question - I don't think of LISTEN or
UNLISTEN as being valuable from a transaction perspective. It's possible
I'm missing something - but I think the transaction overhead, and
attempts to re-use PostgreSQL tables to implement LISTEN/NOTIFY to be
clever but mis-guided. To be practical, LISTEN/NOTIFY should be as fast
as possible, and should never create performance problems, or incur
performance overhead related to transactions.

I had thought of using LISTEN/NOTIFY recently, and upon reading the
threads leading up to this, I was disappointed to hear, and that see for
myself, how asynchronous notify was not immediate within psql, and how
under some circumstances, even with asynchronous notify, it may take a
rather lengthy time before the notify reaches the target. I expect such
notification to be nearly instantaneous, and given this knowledge, I
would choose to use a LISTEN/NOTIFY mechanism outside PostgreSQL for my
next project. Now, does LISTEN/NOTIFY belong outside PostgreSQL in the
first place? I'm not sure...

Cheers,
mark

--
Mark Mielke <mark(at)mielke(dot)cc>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-03-11 01:58:22 Re: LISTEN vs. two-phase commit
Previous Message Tom Lane 2008-03-11 01:45:48 Re: [PATCHES] Fix for large file support (nonsegment mode support)