DBLINK_ERROR_MESSAGE(3)

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

✨ NAME ✨

Okay bestie, welcome to the DBLINK_ERROR_MESSAGE(3) page from the PostgreSQL 16.15 Documentation πŸ’… This is all about dblink_error_message β€” it gets the last error message on the named connection. No cap. 🫢

πŸ›°οΈ SYNOPSIS πŸ›°οΈ

dblink_error_message(text connname) returns text

πŸ’¬ DESCRIPTION πŸ’¬

dblink_error_message fetches the most recent remote error message for a given connection. It's literally giving β€œwhat went wrong last on this connection?” energy. 🌸

🧚 ARGUMENTS 🧚

  • connname β€” name of the connection to use. That's the connection you're checking, bestie. πŸŽ€

πŸŽ€ RETURN VALUE πŸŽ€

Returns the last error message, or OK if there has been no error in this connection. Simple as that, periodt. ⭐

πŸ¦‹ NOTES πŸ¦‹

Lowkey important: 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. Fr fr, check those first so the async error actually shows up. πŸ’œ

🌈 EXAMPLES 🌈

SELECT dblink_error_message('dtest1');

Manual page vibe check complete: source/version is PostgreSQL 16.15, date is 2026. Stay slaying your connections, bestie πŸ’–πŸ‘‘βœ¨

πŸ“¦ where this page comes from