pg.ddx.io pgaudit/pgaudit GitHub issues and pull requests
help / color / mirror / Atom feed[pgaudit/pgaudit] issue #316: Redacted statements should still be valid SQL
6+ messages / 2 participants
[nested] [flat]
* [pgaudit/pgaudit] issue #316: Redacted statements should still be valid SQL
@ 2026-06-01 09:13 "filip-taxamo (@filip-taxamo)" <noreply+filip-taxamo@github.com>
0 siblings, 0 replies; 6+ messages in thread
From: filip-taxamo (@filip-taxamo) @ 2026-06-01 09:13 UTC (permalink / raw)
To: pgaudit/pgaudit <noreply+pgaudit-pgaudit@github.com>
We use pgaudit together with [pglast](https://pypi.org/project/pglast/) that we use to parse the logged statements.
Its generally works nicely, but there is a corner case where `pglast` is not happy with the result of [pgaudit password redaction](https://github.com/pgaudit/pgaudit/blob/34f123e632e27215cdf5ee1ada9bfa888f3e0e02/pgaudit.c#L643-L665), for example the following entry:
```
CREATE USER
\t pgexporter
\tWITH
\t PASSWORD <REDACTED>
```
results in:
```
[ERROR] ParseError: syntax error at or near "<", at index 44
[...]
File "/var/task/rds_pgaudit_parser.py", line 225, in parse
for statement in pglast.split(ev["statement"]):
File "pglast/parser.pyx", line 412, in pglast.parser.split
```
[pglast/parser.pyx:412](https://github.com/lelit/pglast/blob/v7.7/pglast/parser.pyx#L412)
Would it be acceptable to change the [TOKEN_REDACTED](https://github.com/pgaudit/pgaudit/blob/34f123e632e27215cdf5ee1ada9bfa888f3e0e02/pgaudit.c#L224) constant from `"<REDACTED>"` to `"'<REDACTED>'"` so that the statement after redaction is still valid SQL?
^ permalink raw [nested|flat] 6+ messages in thread
* Re: [pgaudit/pgaudit] issue #316: Redacted statements should still be valid SQL
@ 2026-06-01 10:40 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
4 siblings, 0 replies; 6+ messages in thread
From: dwsteele (@dwsteele) @ 2026-06-01 10:40 UTC (permalink / raw)
To: pgaudit/pgaudit <noreply+pgaudit-pgaudit@github.com>
@dwsteele assigned @dwsteele.
^ permalink raw [nested|flat] 6+ messages in thread
* Re: [pgaudit/pgaudit] issue #316: Redacted statements should still be valid SQL
@ 2026-06-01 10:40 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
4 siblings, 0 replies; 6+ messages in thread
From: dwsteele (@dwsteele) @ 2026-06-01 10:40 UTC (permalink / raw)
To: pgaudit/pgaudit <noreply+pgaudit-pgaudit@github.com>
@dwsteele applied label "question".
^ permalink raw [nested|flat] 6+ messages in thread
* Re: [pgaudit/pgaudit] issue #316: Redacted statements should still be valid SQL
@ 2026-06-01 10:41 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
4 siblings, 0 replies; 6+ messages in thread
From: dwsteele (@dwsteele) @ 2026-06-01 10:41 UTC (permalink / raw)
To: pgaudit/pgaudit <noreply+pgaudit-pgaudit@github.com>
This seems reasonable to me but it is not something we could back patch (so PG19+ only). Would you be willing to submit a PR for this change?
^ permalink raw [nested|flat] 6+ messages in thread
* Re: [pgaudit/pgaudit] issue #316: Redacted statements should still be valid SQL
@ 2026-06-26 10:12 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
4 siblings, 0 replies; 6+ messages in thread
From: dwsteele (@dwsteele) @ 2026-06-26 10:12 UTC (permalink / raw)
To: pgaudit/pgaudit <noreply+pgaudit-pgaudit@github.com>
@dwsteele closed this.
^ permalink raw [nested|flat] 6+ messages in thread
* Re: [pgaudit/pgaudit] issue #316: Redacted statements should still be valid SQL
@ 2026-06-26 10:12 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
4 siblings, 0 replies; 6+ messages in thread
From: dwsteele (@dwsteele) @ 2026-06-26 10:12 UTC (permalink / raw)
To: pgaudit/pgaudit <noreply+pgaudit-pgaudit@github.com>
Closing this -- just open a PR when you have the patch ready.
^ permalink raw [nested|flat] 6+ messages in thread
end of thread, other threads:[~2026-06-26 10:12 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-06-01 09:13 [pgaudit/pgaudit] issue #316: Redacted statements should still be valid SQL "filip-taxamo (@filip-taxamo)" <noreply+filip-taxamo@github.com>
2026-06-01 10:40 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
2026-06-01 10:40 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
2026-06-01 10:41 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
2026-06-26 10:12 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
2026-06-26 10:12 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox