DBLINK_SEND_QUERY(3)

πŸ“¦ version 13.23, in opensuse-leap 16.0

okay so bestie, welcome to the dblink_send_query page β€” it lives in the PostgreSQL 13.23 docs and it's genuinely one of the handiest little gremlins in the dblink family πŸ¦‹


🌸 NAME 🌸

dblink_send_query β€” sends an async query to a remote database ✨

πŸŽ€ SYNOPSIS πŸŽ€

dblink_send_query(text connname, text sql) returns int

πŸ’– DESCRIPTION πŸ’–

so dblink_send_query sends a query that gets executed asynchronously β€” meaning it fires it off without immediately waiting around for the result like some clingy ex 😭 it's giving "send it and go live your life" energy, fr fr.

⚠️ huge caveat incoming: there must not already be an async query in progress on the connection. like, one at a time, bestie. no cap. 🚫

once you've successfully dispatched an async query πŸ‘‘, you can check the completion status with dblink_is_busy, and the results are ultimately collected with dblink_get_result. also, lowkey iconic: you can try to cancel an active async query using dblink_cancel_query 🧚

⭐ ARGUMENTS ⭐

  • connname β€” the name of the connection to use πŸ’«
  • sql β€” the SQL statement you wish to execute in the remote database. for example, select * from pg_class πŸ“

πŸ”₯ RETURN VALUE πŸ”₯

returns 1 if the query was successfully dispatched, and 0 otherwise. that's it, that's the vibe check πŸ’€

🌈 EXAMPLES 🌈

SELECT dblink_send_query('dtest1', 'SELECT * FROM foo WHERE f1 < 3');

and that's the whole page, bestie, you ate πŸ’…βœ¨

cute little sign-off: this was pulled from the PostgreSQL 13.23 documentation, dated 2025, and it's literally the DBLINK_SEND_QUERY(3) page 🫢 go forth and async responsibly πŸ’œ

πŸ“¦ where this page comes from