pg.ddx.io  psycopg/psycopg GitHub issues and pull requests  
help / color / mirror / Atom feed
[psycopg/psycopg] issue #1291: Notice Handling During Start Up Phase
4+ messages / 3 participants
[nested] [flat]

* [psycopg/psycopg] issue #1291: Notice Handling During Start Up Phase
@ 2026-04-08 13:30  "AndrewJackson2020 (@AndrewJackson2020)" <noreply+AndrewJackson2020@github.com>
  0 siblings, 0 replies; 4+ messages in thread

From: AndrewJackson2020 (@AndrewJackson2020) @ 2026-04-08 13:30 UTC (permalink / raw)
  To: psycopg/psycopg <noreply+psycopg-psycopg@github.com>

In postgres wire protocol it is possible to send a notice during the start-up[0] phase: after AuthenticationOk has been received by the client but before ReadyForQuery. Is it possible to get these notices via psycopg3? It seems like `add_notice_handler` [1] can only happen after a connection object has been initialized, by which time the notices would have already been sent.

[0] https://www.postgresql.org/docs/current/protocol-flow.html#PROTOCOL-FLOW-START-UP
[1] https://www.psycopg.org/psycopg3/docs/api/connections.html#psycopg.Connection.remove_notify_handler

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

* Re: [psycopg/psycopg] issue #1291: Notice Handling During Start Up Phase
@ 2026-04-08 14:20  "dvarrazzo (@dvarrazzo)" <noreply+dvarrazzo@github.com>
  2 siblings, 0 replies; 4+ messages in thread

From: dvarrazzo (@dvarrazzo) @ 2026-04-08 14:20 UTC (permalink / raw)
  To: psycopg/psycopg <noreply+psycopg-psycopg@github.com>

Mmm... we could think about addressing it.

Maybe we could install a temporary handler on connection and play back the notices as soon as the user install a handler of their own? It seems easier and doesn't require waiting for psycopg 3.4 than e.g. passing a notice handler as connection argument.

Not planning to do it immediately (in the next couple of weeks) but we could have a thought about how the fix would look like.

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

* Re: [psycopg/psycopg] issue #1291: Notice Handling During Start Up Phase
@ 2026-04-08 14:41  "AndrewJackson2020 (@AndrewJackson2020)" <noreply+AndrewJackson2020@github.com>
  2 siblings, 0 replies; 4+ messages in thread

From: AndrewJackson2020 (@AndrewJackson2020) @ 2026-04-08 14:41 UTC (permalink / raw)
  To: psycopg/psycopg <noreply+psycopg-psycopg@github.com>

Thank you, not urgent at all. 

This is a fairly obscure piece of functionality imo. For reference I encountered this while working on the below PR for pgbouncer. Tried to test it using psycopg but had to fall back to using psql when I realized the handler would not pick up start-up phase notifies.

[0] https://github.com/pgbouncer/pgbouncer/pull/1488

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

* Re: [psycopg/psycopg] issue #1291: Notice Handling During Start Up Phase
@ 2026-11-12 11:57  "Binary-Refinery (@Binary-Refinery)" <noreply+Binary-Refinery@github.com>
  2 siblings, 0 replies; 4+ messages in thread

From: Binary-Refinery (@Binary-Refinery) @ 2026-11-12 11:57 UTC (permalink / raw)
  To: psycopg/psycopg <noreply+psycopg-psycopg@github.com>

I can reduce the PgBouncer startup notice to one reproducible connection and compare what psql and psycopg receive. Would that be useful before deciding whether to buffer notices until a handler is attached?

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


end of thread, other threads:[~2026-11-12 11:57 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-04-08 13:30 [psycopg/psycopg] issue #1291: Notice Handling During Start Up Phase "AndrewJackson2020 (@AndrewJackson2020)" <noreply+AndrewJackson2020@github.com>
2026-04-08 14:20 ` "dvarrazzo (@dvarrazzo)" <noreply+dvarrazzo@github.com>
2026-04-08 14:41 ` "AndrewJackson2020 (@AndrewJackson2020)" <noreply+AndrewJackson2020@github.com>
2026-11-12 11:57 ` "Binary-Refinery (@Binary-Refinery)" <noreply+Binary-Refinery@github.com>

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