From: | "Jeroen T(dot) Vermeulen" <jtv(at)xs4all(dot)nl> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Neil Conway <neilc(at)samurai(dot)com>, PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org> |
Subject: | Re: psql patch |
Date: | 2003-02-24 18:13:43 |
Message-ID: | 20030224181343.GE97071@xs4all.nl |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Manfred Spraul | 2003-02-24 18:24:09 | performance: use pread instead of lseek+read |
Previous Message | Tom Lane | 2003-02-24 17:36:56 | Re: psql patch |