aws / aws/pg_tle

RAISE NOTICE in extension scripts is silently dropped by CREATE/ALTER EXTENSION

Open Beginner friendly
#315 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C
Stars
410
Forks
41
Avg merge
18h 17m
Merged PRs (30d)
2

Description

## Description

`pg_tle`'s install and update scripts contain seven `RAISE NOTICE` statements meant to inform operators about role creation, disabled feature GUCs, and misconfigured `passcheck_db_name` / `clientauth_db_name`. None of them ever reach the client, because Postgres's `execute_extension_script` clamps `client_min_messages` and `log_min_messages` to at least `WARNING` for the duration of `CREATE EXTENSION` and `ALTER EXTENSION UPDATE`.

## Steps to reproduce

1. `SET client_min_messages = notice;`
1. `CREATE ROLE pgtle_admin NOLOGIN;`
1. `CREATE EXTENSION pg_tle;`

## Expected outcome

```
NOTICE: Role "pgtle_admin" already exists. Skipping.
```

## Actual outcome

No output. The `NOTICE` is silently dropped by `execute_extension_script`'s severity clamp.

## Analysis

The same clamp affects all seven sites: `pg_tle--1.0.0.sql:281`, `pg_tle--1.0.4.sql:348`, `pg_tle--1.1.1.sql:340`, and `pg_tle--1.3.4--1.4.0.sql:91,95,103,106`.

Recommended fix: promote each `RAISE NOTICE` to `RAISE WARNING` — the lowest severity that survives the clamp — and update `test/expected/*.out` to match. I have a working patch with `make installcheck` green locally and can open a PR.

Contributor guide

Open the contributing guide

Research direction

Start with the seven RAISE NOTICE sites named 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. Review the corresponding test/expected/*.out files, then run make installcheck; done means the messages appear during extension creation or update and the expected outputs match.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql
Domain
databases
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.