Skip to content

Emit WARNING instead of NOTICE in extension scripts#318

Open
zjyzh wants to merge 1 commit into
aws:mainfrom
zjyzh:raise-warning-in-extension-scripts
Open

Emit WARNING instead of NOTICE in extension scripts#318
zjyzh wants to merge 1 commit into
aws:mainfrom
zjyzh:raise-warning-in-extension-scripts

Conversation

@zjyzh

@zjyzh zjyzh commented Jul 23, 2026

Copy link
Copy Markdown

Description of the change

Bug

Seven RAISE NOTICE calls in the pg_tle install scripts never reach the client or the log. Operators get no guidance when they hit them.

Root cause

Postgres's execute_extension_script() clamps client_min_messages and log_min_messages to at least WARNING for the duration of CREATE/ALTER EXTENSION. NOTICE-level messages raised from inside an extension script are dropped.

Fix

Promote the seven NOTICE calls to WARNING so the guidance survives the clamp. Sites: the "role already exists" guard in pg_tle--1.0.0.sql / 1.0.4.sql / 1.1.1.sql, and four config-guidance messages inside pgtle.register_feature in pg_tle--1.3.4--1.4.0.sql.

Branches

aws/pg_tle:mainraise-warning-in-extension-scripts, commit c248746.

Testing

make installcheck on PostgreSQL 17.10, cold cluster: 10/10 regression + 107/107 TAP pass. Seven .out files updated to match the new severity label.

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

execute_extension_script() clamps client_min_messages and
log_min_messages to at least WARNING for the duration of
CREATE/ALTER EXTENSION, so NOTICE-level messages raised from
extension scripts are silently dropped. Promote the seven NOTICE
calls in pg_tle--1.0.0.sql, pg_tle--1.0.4.sql, pg_tle--1.1.1.sql,
and pg_tle--1.3.4--1.4.0.sql (pgtle.register_feature body) to
WARNING so the guidance reaches the client. Update regression
expected output to match.
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.

1 participant