DBLINK_ERROR_MESSAGE(3)

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

πŸŽ€ NAME πŸŽ€

okay so welcome to DBLINK_ERROR_MESSAGE(3) β€” this is the little PostgreSQL page that tells you how to grab the last error message from a named connection. It’s giving β€œerror receipts, but make it remote.” πŸ’…

✨ SYNOPSIS ✨

dblink_error_message(text connname) returns text

πŸ¦‹ DESCRIPTION πŸ¦‹

dblink_error_message fetches the most recent remote error message for a given connection. So if your remote connection has been going through it, this is where you go to read the drama. 😭

🌸 ARGUMENTS 🌸

  • connname β€” the name of the connection to use. That’s the connection whose last error message you’re asking about, bestie. πŸ’–

🫢 RETURN VALUE 🫢

It returns the last error message, or OK if there has been no error in this connection. So OK is literally the β€œno notes, we’re fine” response. ✨

πŸ’€ 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.

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. Translation: check the async situation first, or the error might still be backstage waiting for its main character moment. πŸ‘‘πŸ« 

🌈 EXAMPLES 🌈

SELECT dblink_error_message('dtest1');

made with πŸ’– from PostgreSQL 15.19 Β· 2026 Β· DBLINK_ERROR_MESSAGE(3)

πŸ“¦ where this page comes from