Giter Site home page Giter Site logo

Comments (6)

dwsteele avatar dwsteele commented on May 18, 2024

Truncate is included in the WRITE class: https://github.com/pgaudit/pgaudit#pgauditlog. Object logging is not possible with truncate.

from pgaudit.

ksiddi01 avatar ksiddi01 commented on May 18, 2024

Is there a way to update the code so that WRITE is 'truncate table' only?

from pgaudit.

dwsteele avatar dwsteele commented on May 18, 2024

That would be an interface break, so no. It's possible that it could be added to a new class but that would not happen until PG11 as we don't add features to past versions. I am not in favor since truncate would then be in two classes.

Thoughts @sfrost, @jconway?

from pgaudit.

ksiddi01 avatar ksiddi01 commented on May 18, 2024

Here is the issue I am trying to resolve. WRITE includes INSERT, UPDATE, DELETE, TRUNCATE, and COPY. We would like to audit TRUNCATE only. INSERT, UPDATE and DELETE will generate many audit logs and TRUNCATE is not very common. Any recommendation for auditing TRUNCATE only? Is it permissible/recommended to modify the code for local use? If it is, can I have WRITE for TRUNCATE only?

from pgaudit.

simonat2ndQuadrant avatar simonat2ndQuadrant commented on May 18, 2024

from pgaudit.

dwsteele avatar dwsteele commented on May 18, 2024

ISTM that we could add many new classes that match the first keyword of a command. i.e. Allow INSERT, UPDATE, DELETE, TRUNCATE, COPY as individual classes. That would give a much finer grained ability to filter and would be easy enough to implement.

This seems like a reasonable idea.

we don't add features to past versions.

Surely that is the benefit of an extension?

Generally, yes, but the goal is to keep pgaudit as stable as possible so we have only been back-patching bug fixes, in the model of Postgres core.

This would be a non-trivial change. All commands are now assigned to a single class so a number of places in the code would need to be touched to allow a command in two classes and log it appropriately. I don't see this as an important enough feature to be worth the risk.

I am not in favor since truncate would then be in two classes.
I don't see why that would cause a problem as long as it is documented.

Fair enough.

I would be open to a patch to implement this functionality but don't have time to spend on it myself.

from pgaudit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.