DBLINK_SEND_QUERY(3)
β¨ DBLINK_SEND_QUERY π
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
- opensuse-leap 16.0: postgresql13-docs 13.23-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