Skip to content

Conversation

@aykut-bozkurt
Copy link
Member

@aykut-bozkurt aykut-bozkurt commented Jul 10, 2025

There is an incompatibility between pgaudit and COPY commands. pgaudit expects its own prev_standardUtility to be called before the executor permission check hook is called. However, our COPY command does not call prev_standardUtility, so pgaudit crashes. Instead, here we disable pgaudit for the duration of the COPY command. See pgaudit/pgaudit#212

An example flow to trigger crash before this PR:

CREATE TABLE test(a int);
COPY (SELECT 1) TO '/tmp/test.parquet';
SET audit.log TO 'write';
COPY test FROM '/tmp/test.parquet';

After this PR, the crash won't happen but at the cost of not auditing "copy from parquet" commands.

There is an incompatibility between pgaudit and COPY commands. pgaudit expects its own
prev_standardUtility to be called before the executor permission check
hook is called. However, our COPY command does not call
prev_standardUtility, so pgaudit crashes. Instead, here we disable pgaudit for the duration
of the COPY command. See pgaudit/pgaudit#212
@codecov
Copy link

codecov bot commented Jul 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.32%. Comparing base (6b5a0d5) to head (1db3e9b).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #137      +/-   ##
==========================================
+ Coverage   91.30%   91.32%   +0.02%     
==========================================
  Files          91       91              
  Lines       13153    13194      +41     
==========================================
+ Hits        12009    12050      +41     
  Misses       1144     1144              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

@onderkalaci onderkalaci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add a changelog entry or expand commit message that COPY commands are not audited with pgaudit anymore.

@aykut-bozkurt aykut-bozkurt merged commit aa91e14 into main Jul 10, 2025
6 checks passed
@aykut-bozkurt aykut-bozkurt deleted the aykut/pgaudit-compat branch July 10, 2025 10:09
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.

3 participants