DBLINK_SEND_QUERY(3)
π DBLINK_SEND_QUERY(3) β like, the async remote query one, bestie
okay so this is a PostgreSQL 15.19 manual page, it's dblink_send_query(3), and honestly? she's kind of a vibe. sit down, grab a strawberry drink π, and let me tell you everything.
β¨ NAME β¨
dblink_send_query β sends an async query to a remote database. that's it. that's the whole thing. fire. π₯
πΈ SYNOPSIS πΈ
dblink_send_query(text connname, text sql) returns int
look at her. two text args, returns an int. iconic signature, no notes. π
π¦ DESCRIPTION π¦
so dblink_send_query sends a query to be executed asynchronously β meaning it fires the query off without immediately waiting for the result. it's giving "i sent the text, i'm not staring at the screen waiting for the typing bubble" energy. π
but listen β there must not be an async query already in progress on the connection. like, one at a time, bestie. no cap.
after 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. π
it's also possible to attempt to cancel an active async query using dblink_cancel_query.
so the whole little friend group isdblink_send_queryβdblink_is_busyβdblink_get_result, withdblink_cancel_queryas the "jk nvm" option. iykyk. π§
π ARGUMENTS π
connnameβ name of the connection to use. literally the name of the connection. that's the whole job and she does it flawlessly. π«Άsqlβ the SQL statement that you wish to execute in the remote database, for exampleselect * from pg_class. go off, query queen. β
π RETURN VALUE π
returns 1 if the query was successfully dispatched, 0 otherwise. binary queen. no in-between. π
π₯ EXAMPLES π₯
here's the moment you've been waiting for, the demo:
SELECT dblink_send_query('dtest1', 'SELECT * FROM foo WHERE f1 < 3');
ate. no crumbs. dtest1 is the connection, and that SELECT is off doing its thing asynchronously. πβ¨
and that's the page!! fr fr that's everything, nothing skipped, every last detail accounted for. π
sign-off era π: this was DBLINK_SEND_QUERY(3) from the PostgreSQL 15.19 Documentation, dated 2026 β and the footer still says DBLINK_SEND_QUERY(3) because she's consistent like that. mwah. ππ¦
π¦ where this page comes from
- opensuse-leap 16.0: postgresql15-docs 15.19-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