Skip to content

[Feature] Add support for ereport_domain macro#2256

Open
songwdfu wants to merge 1 commit intopgcentralfoundation:developfrom
songwdfu:develop
Open

[Feature] Add support for ereport_domain macro#2256
songwdfu wants to merge 1 commit intopgcentralfoundation:developfrom
songwdfu:develop

Conversation

@songwdfu
Copy link

@songwdfu songwdfu commented Mar 10, 2026

What is the problem
Postgres provides the TEXTDOMAIN macro and ereport_domain macro to allow a domain to be specified for log messages.
It could be read from edata->domain. This might be a feature that people building extensions want to use (or misuse).

Currently pgrx hardcodes the domain as NULL. It would be great if it could provide some way for people to specify it.

Issue here

How does this PR solves this
This is a small PR that modifies the ErrorReport struct to add the domain field, and defines the ereport_domain macros.

Support specifying a domain for logs analogous to postgres'
ereport_domain macro
@songwdfu songwdfu changed the title Add support for ereport_domain macro [Feature] Add support for ereport_domain macro Mar 10, 2026
@songwdfu songwdfu marked this pull request as ready for review March 10, 2026 06:47
@eeeebbbbrrrr
Copy link
Contributor

This generally looks good. Would you mind also adding some tests around it? we have a pgrx-tests/src/tests/log_tests.rs file where you could put them, probably following the same patterns.

If you're up for that, I'm more than happy to merge.

@songwdfu
Copy link
Author

Will do :) Will pin here once done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants