PG_ON_CONNECTION_LOSS(n)

πŸ“¦ version 3.1.1, in alpine 3.22, alpine 3.23, alpine 3.24, nixpkgs unstable

πŸ’… pg_on_connection_loss πŸ’…

πŸŽ€ NAME πŸŽ€

okay so bestie, pg_on_connection_loss β€” set or change a callback for unexpected connection loss. This page comes straight from the PostgreSQL Tcl Interface Documentation, and it's here to help you handle that "wait, where did the database go?" moment with main character energy. πŸ’–


✨ SYNOPSIS ✨

pg_on_connection_loss conn [callbackCommand]

πŸ’– DESCRIPTION πŸ’–

pg_on_connection_loss creates, changes, or cancels a request to execute a callback command if an unexpected loss of connection to the database occurs. The way it works is lowkey simple:

  • With a callbackCommand parameter, the request is established, or the command string of an already existing request is replaced. Slay. ✨
  • With no callbackCommand parameter, a prior request is canceled. Bye bestie. πŸ‘‹

The callback command string is executed from the Tcl idle loop. That is the normal idle state of an application written with Tk. In non-Tk Tcl shells, you can execute update or vwait to cause the idle loop to be entered. iykyk 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • conn β€” the handle to watch for connection losses. πŸ‘€
  • callbackCommand β€” if present, provides the command string to execute when connection loss is detected. πŸŽ€

🌸 RETURN VALUE 🌸

None. That's it. Nothing returned. periodt. πŸ’…


🫢 signed, sealed, delivered: this page is from the PostgreSQL Tcl Interface Documentation, dated 17 September 2020. no cap. πŸ’–
πŸ“¦ where this page comes from