On Sat, Nov 16, 2024 at 09:43:12PM +0100, Alvaro Herrera wrote: > I just noticed that this commit broke pgaudit pretty thoroughly. I'm > not sure if this means pgaudit needs changes, or this commit needs to be > reconsidered in some way; at this point I'm just raising the alarm. > > (FWIW there are a few other pgaudit-breaking changes in 18, but they > don't seem as bad as this one, to the extent that the fixes likely > belong into pgaudit.)
Thanks for the heads-up. I have looked at that, and as far as I can see this is something that I think is an improvement for pgaudit because we are able to track more precisely the subqueries that are run as part of a CTAS or an EXPLAIN. Well, that's the whole point of what's been done by Anthonin. Here are a couple of examples from regression.diffs: -NOTICE: AUDIT: SESSION,5,1,READ,SELECT,,,CREATE TABLE tmp2 AS (SELECT * FROM tmp),<not logged> +NOTICE: AUDIT: SESSION,5,1,READ,SELECT,,,SELECT * FROM tmp,<not logged> [...] -NOTICE: AUDIT: SESSION,30,1,READ,SELECT,,,explain select 1,<none> +NOTICE: AUDIT: SESSION,30,1,READ,SELECT,,,select 1,<none> NOTICE: AUDIT: SESSION,30,2,MISC,EXPLAIN,,,explain select 1,<none> We still track the parent query and it is intact. Things change so as the subquery showing in the logs is actually what's running, not what's part of the parent query. This one also looks less confusing to me: -WARNING: AUDIT: OBJECT,1,1,WRITE,INSERT,TABLE,public.test4,"PREPARE testinsert(int, text) AS - INSERT INTO test4 VALUES($1, $2)","1,<long param suppressed>" +WARNING: AUDIT: OBJECT,1,1,WRITE,INSERT,TABLE,public.test4,"INSERT INTO test4 VALUES($1, $2)","1,<long param suppressed>" As a whole, it seems to me that this requires a refresh of the regression test output. (I've found two small issues for pgaudit, will send some pull requests in a few minutes.) -- Michael
signature.asc
Description: PGP signature