pg.ddx.io  pgaudit/pgaudit GitHub issues and pull requests  
help / color / mirror / Atom feed
From: dwsteele (@dwsteele) <noreply+dwsteele@github.com>
To: pgaudit/pgaudit <noreply+pgaudit-pgaudit@github.com>
Subject: Re: [pgaudit/pgaudit] PR #321: Report rows affected by COPY when pgaudit.log_rows is enabled.
Date: Tue, 21 Jul 2026 04:51:22 +0000
Message-ID: <gh-pgaudit-pgaudit-321-c5030281164@github.com> (raw)
In-Reply-To: <gh-pgaudit-pgaudit-321@github.com>
References: <gh-pgaudit-pgaudit-321@github.com>

The output will be different in terms of audit entries but should be the same in rows reported:
```
COPY h TO stdout;
AUDIT: SESSION,147,1,READ,COPY,TABLE,public.h,COPY h TO stdout,<none>,3
```
vs.
```
COPY (SELECT * FROM h) TO stdout;
AUDIT: SESSION,148,1,READ,SELECT,TABLE,public.h,COPY (SELECT * FROM h) TO stdout,<none>,3
AUDIT: SESSION,148,2,READ,COPY,,,COPY (SELECT * FROM h) TO stdout,<none>,0
```

This case did expose yet another bug, though, which is fixed in ca82d891dea so the corrected output is:
```
COPY (SELECT * FROM h) TO stdout;
AUDIT: SESSION,148,1,READ,SELECT,TABLE,public.h,COPY (SELECT * FROM h) TO stdout,<none>,3
AUDIT: SESSION,148,2,READ,COPY,,,COPY (SELECT * FROM h) TO stdout,<none>,3
```

view thread (10+ messages)  latest in thread

Message-ID: <gh-pgaudit-pgaudit-321-c5030281164@github.com>
Permalink:  ../gh-pgaudit-pgaudit-321-c5030281164@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