agora inbox for pgsql-docs@postgresql.org  
help / color / mirror / Atom feed
Size limit for NOTIFY payload
4+ messages / 3 participants
[nested] [flat]

* Size limit for NOTIFY payload
@ 2024-12-16 08:01  sulfinu@gmail.com
  0 siblings, 1 reply; 4+ messages in thread

From: sulfinu@gmail.com @ 2024-12-16 08:01 UTC (permalink / raw)
  To: pgsql-docs@lists.postgresql.org

Hello,

according to the documentation
<https://www.postgresql.org/docs/current/sql-notify.html;, the payload
given in a NOTIFY statement must not exceed a certain limit *in bytes*. But
the payload is a character string, therefore the limit remains unclear.

What's the character encoding of the NOTIFY payload, is it the default
database encoding?

Thanks.

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

* Re: Size limit for NOTIFY payload
@ 2024-12-18 16:29  Tom Lane <tgl@sss.pgh.pa.us>
  parent: sulfinu@gmail.com
  0 siblings, 1 reply; 4+ messages in thread

From: Tom Lane @ 2024-12-18 16:29 UTC (permalink / raw)
  To: sulfinu@gmail.com; +Cc: pgsql-docs@lists.postgresql.org

sulfinu@gmail.com writes:
> What's the character encoding of the NOTIFY payload, is it the default
> database encoding?

It's whatever encoding your database uses; NOTIFY doesn't do any
transcoding.

(We'd have to think harder about that if NOTIFY messages could cross
database boundaries ... but they don't today.)

			regards, tom lane





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

* Re: Size limit for NOTIFY payload
@ 2024-12-19 09:00  sulfinu@gmail.com
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 4+ messages in thread

From: sulfinu@gmail.com @ 2024-12-19 09:00 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-docs@lists.postgresql.org

Well, as I said, that's a *text* value with a *byte* limit. The
documentation should definitely mention something like *"with the default
database encoding"*.

În mie., 18 dec. 2024 la 18:29, Tom Lane <tgl@sss.pgh.pa.us> a scris:

> sulfinu@gmail.com writes:
> > What's the character encoding of the NOTIFY payload, is it the default
> > database encoding?
>
> It's whatever encoding your database uses; NOTIFY doesn't do any
> transcoding.
>
> (We'd have to think harder about that if NOTIFY messages could cross
> database boundaries ... but they don't today.)
>
>                         regards, tom lane
>

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

* Re: Size limit for NOTIFY payload
@ 2024-12-20 14:16  Greg Sabino Mullane <htamfids@gmail.com>
  parent: sulfinu@gmail.com
  0 siblings, 0 replies; 4+ messages in thread

From: Greg Sabino Mullane @ 2024-12-20 14:16 UTC (permalink / raw)
  To: sulfinu@gmail.com; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-docs@lists.postgresql.org

On Fri, Dec 20, 2024 at 5:53 AM <sulfinu@gmail.com> wrote:

> Well, as I said, that's a *text* value with a *byte* limit. The
> documentation should definitely mention something like *"with the default
> database encoding"*.
>

I'm not sure why you think adding such wordage is needed. Bytes is bytes.
Your application should be checking the number of bytes in the string sent
to NOTIFY.

On a related note, if you find yourself approaching the payload limits, you
might want to rethink the way you are using LISTEN/NOTIFY.

Cheers,
Greg

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


end of thread, other threads:[~2024-12-20 14:16 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-12-16 08:01 Size limit for NOTIFY payload sulfinu@gmail.com
2024-12-18 16:29 ` Tom Lane <tgl@sss.pgh.pa.us>
2024-12-19 09:00   ` sulfinu@gmail.com
2024-12-20 14:16     ` Greg Sabino Mullane <htamfids@gmail.com>

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