DBLINK_SEND_QUERY(3)

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

✨ NAME ✨

okay so bestie, meet dblink_send_query(3) β€” the PostgreSQL 17.11 manual page for sending an async query to a remote database. it’s giving β€œfire and forget, but make it SQL” πŸ’…

🌸 SYNOPSIS 🌸

dblink_send_query(text connname, text sql) returns int

πŸ¦‹ DESCRIPTION πŸ¦‹

dblink_send_query sends a query to be executed asynchronously β€” meaning it dispatches the query without immediately waiting for the result. no sitting around staring at the loading spinner, periodt.

heads up, bestie: there must not already be an async query in progress on the connection. like, none. zero. this is not the vibe.

after successfully dispatching an async query, you can check completion status with dblink_is_busy, and the results are ultimately collected with dblink_get_result. you can also attempt to cancel an active async query using dblink_cancel_query. iconic little function family, fr fr πŸ”₯

πŸŽ€ ARGUMENTS πŸŽ€

  • connname β€” name of the connection to use. that’s the connection you’re sending the async query through 🫢
  • sql β€” the SQL statement you wish to execute in the remote database, for example select * from pg_class. yes, literally that one 😌

πŸ‘‘ RETURN VALUE πŸ‘‘

returns 1 if the query was successfully dispatched, 0 otherwise. no cap, that’s the whole vibe check πŸ’–

🌈 EXAMPLES 🌈

run this little icon:

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

mwah πŸ’‹ β€” this iconic page is from PostgreSQL 17.11, dated 2026. slay, bestie, go send that async query πŸ§šπŸ’œ

πŸ“¦ where this page comes from