DBLINK_ERROR_MESSAGE(3)
π DBLINK_ERROR_MESSAGE(3) π
okay so bestie, we're in the dblink_error_message era of the PostgreSQL 13.23 Documentation and honestly? this one is a little lifesaver π«Ά
β¨ NAME β¨
dblink_error_message β the function that grabs the last error message on the named connection π
π SYNOPSIS π
dblink_error_message(text connname) returns text
π¦ DESCRIPTION π¦
So like, dblink_error_message fetches the most recent remote error message for a given connection. That's it, that's the whole vibe. You point it at a connection, it hands you back the tea on what went wrong last π₯
πΈ ARGUMENTS πΈ
connnameβ the name of the connection you wanna use, bestie. that's the one.
π RETURN VALUE π
Returns the last error message, or OK if there has been no error in this connection. no drama, no error, just OK β¨
β NOTES β
okay this is the part where you gotta pay attention, because it's giving sneaky π
When asynchronous queries are initiated by dblink_send_query, the error message associated with the connection might not get updated until the server's response message is consumed. lowkey important!!
What that typically means: dblink_is_busy or dblink_get_result should be called prior to dblink_error_message, so that any error generated by the asynchronous query will actually be visible. like, do the steps in order or you'll be out here wondering why your error message is stale π
π§ EXAMPLES π§
SELECT dblink_error_message('dtest1');
and that's the whole page, bestie, no cap π
sign-off era: this iconic little page came to you courtesy of PostgreSQL 13.23, dated 2025, and it's filed under DBLINK_ERROR_MESSAGE(3). slay π
π
π¦ 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