agora inbox for pgsql-interfaces@postgresql.org  
help / color / mirror / Atom feed
Listen/Notify payload and interfaces
6+ messages / 3 participants
[nested] [flat]

* Listen/Notify payload and interfaces
@ 2010-02-17 08:39  Joachim Wieland <joe@mcknight.de>
  0 siblings, 1 reply; 6+ messages in thread

From: Joachim Wieland @ 2010-02-17 08:39 UTC (permalink / raw)
  To: pgsql-hackers <pgsql-hackers@postgresql.org>

This one is for the maintainers of the various postgresql interfaces:

With the new listen/notify implementation we can send a payload along
with the notification. This has been in the protocol already since
years and there is no change needed for libpq. However we need to
adapt the various interfaces to allow a payload to be sent and
received.

A notification is sent via SQL:

http://developer.postgresql.org/pgdocs/postgres/sql-notify.html


and received via the libpq call PQnotifies:

http://developer.postgresql.org/pgdocs/postgres/libpq-notify.html



Joachim



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: [HACKERS] Listen/Notify payload and interfaces
@ 2010-02-17 18:04  Greg Sabino Mullane <greg@turnstep.com>
  parent: Joachim Wieland <joe@mcknight.de>
  0 siblings, 1 reply; 6+ messages in thread

From: Greg Sabino Mullane @ 2010-02-17 18:04 UTC (permalink / raw)
  To: pgsql-hackers@postgresql.org; +Cc: pgsql-interfaces


-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160


> With the new listen/notify implementation we can send a payload along
> with the notification. This has been in the protocol already since
> years and there is no change needed for libpq. However we need to
> adapt the various interfaces to allow a payload to be sent and
> received.

DBD::Pg has been ready since 2008, if you need something to test with. :)

Usage is:

while (my $notify = $dbh->pg_notifies) {
  my ($name, $pid, $payload) = @$notify;
  print qq{I received notice "$name" from PID $pid, payload was "$payload"\n};                                            
}

Not sure what you mean by adapting interfaces to send payloads, I imagine 
most if not all simply require a NOTIFY to be sent via PQexec.

- -- 
Greg Sabino Mullane greg@turnstep.com
End Point Corporation http://www.endpoint.com/
PGP Key: 0x14964AC8 201002171302
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iEYEAREDAAYFAkt8L3oACgkQvJuQZxSWSsik0wCfZexc8ZU2/zo4JZQ47YblKend
yEMAoLdG4IS3pc163UVSpQ11/de+xzUT
=dx6+
-----END PGP SIGNATURE-----





^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: [HACKERS] Listen/Notify payload and interfaces
@ 2010-02-17 20:50  David E. Wheeler <david@kineticode.com>
  parent: Greg Sabino Mullane <greg@turnstep.com>
  0 siblings, 1 reply; 6+ messages in thread

From: David E. Wheeler @ 2010-02-17 20:50 UTC (permalink / raw)
  To: Greg Sabino Mullane <greg@turnstep.com>; +Cc: pgsql-hackers@postgresql.org; pgsql-interfaces

On Feb 17, 2010, at 10:04 AM, Greg Sabino Mullane wrote:

> while (my $notify = $dbh->pg_notifies) {
>  my ($name, $pid, $payload) = @$notify;
>  print qq{I received notice "$name" from PID $pid, payload was "$payload"\n};                 
> }
> 
> Not sure what you mean by adapting interfaces to send payloads, I imagine 
> most if not all simply require a NOTIFY to be sent via PQexec.

Is the payload decoded to utf8 when pg_enable_utf8 is true?

Best,

David




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: [HACKERS] Listen/Notify payload and interfaces
@ 2010-02-18 21:01  Greg Sabino Mullane <greg@turnstep.com>
  parent: David E. Wheeler <david@kineticode.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Greg Sabino Mullane @ 2010-02-18 21:01 UTC (permalink / raw)
  To: pgsql-hackers@postgresql.org; +Cc: pgsql-interfaces


-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160


> Is the payload decoded to utf8 when pg_enable_utf8 is true?

No - there's a note in the code to look into that at some point. So 
stick to ASCII for the moment. I'm sure the great DBD::Pg utf-8 
overhaul (where we get rid of the pg_enable_utf8 hack) will encompass 
payloads as well.

- -- 
Greg Sabino Mullane greg@turnstep.com
End Point Corporation http://www.endpoint.com/
PGP Key: 0x14964AC8 201002181600
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8


-----BEGIN PGP SIGNATURE-----

iEYEAREDAAYFAkt9qn4ACgkQvJuQZxSWSsiM0ACgnjJAfKJOfIFzHBvBmXI3j/ZT
lEMAoIV6KwN186oOKqMYa6IQjYPHprzC
=AwK+
-----END PGP SIGNATURE-----





^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: [HACKERS] Listen/Notify payload and interfaces
@ 2010-02-18 21:56  David E. Wheeler <david@kineticode.com>
  parent: Greg Sabino Mullane <greg@turnstep.com>
  0 siblings, 1 reply; 6+ messages in thread

From: David E. Wheeler @ 2010-02-18 21:56 UTC (permalink / raw)
  To: Greg Sabino Mullane <greg@turnstep.com>; +Cc: pgsql-hackers@postgresql.org; pgsql-interfaces

On Feb 18, 2010, at 1:01 PM, Greg Sabino Mullane wrote:

>> Is the payload decoded to utf8 when pg_enable_utf8 is true?
> 
> No - there's a note in the code to look into that at some point. So 
> stick to ASCII for the moment. I'm sure the great DBD::Pg utf-8 
> overhaul (where we get rid of the pg_enable_utf8 hack) will encompass 
> payloads as well.

Is that immanent?

Best,

David



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: [HACKERS] Listen/Notify payload and interfaces
@ 2010-02-18 22:12  Greg Sabino Mullane <greg@turnstep.com>
  parent: David E. Wheeler <david@kineticode.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Greg Sabino Mullane @ 2010-02-18 22:12 UTC (permalink / raw)
  To: pgsql-hackers@postgresql.org; +Cc: pgsql-interfaces


-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160


>> No - there's a note in the code to look into that at some point. So 
>> stick to ASCII for the moment. I'm sure the great DBD::Pg utf-8 
>> overhaul (where we get rid of the pg_enable_utf8 hack) will encompass 
>> payloads as well.

> Is that immanent?

Barring sudden free time, funding, and/or a client request, no.

- -- 
Greg Sabino Mullane greg@turnstep.com
End Point Corporation http://www.endpoint.com/
PGP Key: 0x14964AC8 201002181711
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iEYEAREDAAYFAkt9u0AACgkQvJuQZxSWSsj/8wCcD6qwNvnRoQ+UJWzDuAIM1vh/
7pQAn1yRdO1bKL1qLpX8OeggS4iCl+1j
=sOJR
-----END PGP SIGNATURE-----




^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2010-02-18 22:12 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-02-17 08:39 Listen/Notify payload and interfaces Joachim Wieland <joe@mcknight.de>
2010-02-17 18:04 ` Greg Sabino Mullane <greg@turnstep.com>
2010-02-17 20:50   ` David E. Wheeler <david@kineticode.com>
2010-02-18 21:01     ` Greg Sabino Mullane <greg@turnstep.com>
2010-02-18 21:56       ` David E. Wheeler <david@kineticode.com>
2010-02-18 22:12         ` Greg Sabino Mullane <greg@turnstep.com>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox