DBLINK_ERROR_MESSAGE(3)

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

okay so bestie, this is the DBLINK_ERROR_MESSAGE(3) manual page from the PostgreSQL 17.11 Documentation, and it's giving β€œtiny function, big helper energy.” let's get into it. πŸ’…

✨ NAME ✨

dblink_error_message β€” gets last error message on the named connection.

🌸 SYNOPSIS 🌸

dblink_error_message(text connname) returns text

πŸ¦‹ DESCRIPTION πŸ¦‹

dblink_error_message fetches the most recent remote error message for a given connection. that's it, that's the whole vibe. it's literally the β€œwhat went wrong on this connection” bestie. 🫢

πŸŽ€ ARGUMENTS πŸŽ€

  • connname β€” Name of the connection to use.

πŸ’… RETURN VALUE πŸ’…

Returns last error message, or OK if there has been no error in this connection. no cap, if everything's chill it says OK. ✨

πŸ”₯ NOTES πŸ”₯

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 sneaky, right?

This typically means that 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 be visible. so yeah, do that little check first, iykyk. πŸ’―

🌈 EXAMPLES 🌈

SELECT dblink_error_message('dtest1');

and that's the whole page, bestie. source/version and date for the record: PostgreSQL 17.11, 2026. this was DBLINK_ERROR_MESSAGE(3), and yes she ate. mwah. πŸ’‹πŸ«Ά

πŸ“¦ where this page comes from