DBLINK_SEND_QUERY(3)
β¨ 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 exampleselect * 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
- opensuse-leap 16.0: postgresql17-docs 17.11-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms