Re: psql patch - Mailing list pgsql-patches

From Jeroen T. Vermeulen
Subject Re: psql patch
Date
Msg-id 20030224181343.GE97071@xs4all.nl
Whole thread Raw
In response to Re: psql patch  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
On Mon, Feb 24, 2003 at 12:36:56PM -0500, Tom Lane wrote:

> Not without help from the backend --- you have no idea whether a LISTEN
> command might have been executed via some user-defined function.

True.  Hadn't thought of that.  The backend does identify a direct
LISTEN to the frontend through PQcmdStatus(), but it doesn't say
anything about what happens in functions and such.   And similar for
transactions, I guess.


> Again, it's not all that easy to be sure if you're inside a transaction
> or not.  We looked at this and decided it was impractical to do without
> a protocol addition.

I don't think I followed that discussion to its conclusion at the time,
but it left me with the impression that such an addition was being
considered.

However I just took a look at the docs for readline and apparently it
was designed with select() in mind.  So it should be possible to
implement this without any cost to scalability: the server doesn't
care if the frontend is listening when it sends out the notification,
and the frontend can sleep until either a notification or a keypress
arrives.

Or am I missing something basic here?


Jeroen


pgsql-patches by date:

Previous
From: "Jeroen T. Vermeulen"
Date:
Subject: Re: psql patch
Next
From: "Jeroen T. Vermeulen"
Date:
Subject: Re: psql patch