Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9097263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T00:03:53+00:00 2026-06-17T00:03:53+00:00

Recently my team have get a situation in which some records in our shared

  • 0

Recently my team have get a situation in which some records in our shared test database disappear with no clear reason. Because it’s a shared database (which is utilized by so many teams), so that we can’t track down if it’s a programming mistake or someone just run a bad sql script.

So that I’m looking for a way to notify (at database level) when a row of a specific table A get deleted. I have looked at the Postgres TRIGGER, but it failed to give me the specific sql that cause the deletion.

Is there anyway I can log the sql statement which cause the deletion of some rows in table A?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T00:03:54+00:00Added an answer on June 17, 2026 at 12:03 am

    You would do this to the actual postgres config files:

    http://www.postgresql.org/docs/9.0/static/runtime-config-logging.html

    log_statement (enum)

    Controls which SQL statements are logged. Valid values are none (off), ddl, mod, and all (all statements). ddl logs all data
    

    definition statements, such as CREATE, ALTER, and DROP statements. mod
    logs all ddl statements, plus data-modifying statements such as
    INSERT, UPDATE, DELETE, TRUNCATE, and COPY FROM. PREPARE, EXECUTE, and
    EXPLAIN ANALYZE statements are also logged if their contained command
    is of an appropriate type. For clients using extended query protocol,
    logging occurs when an Execute message is received, and values of the
    Bind parameters are included (with any embedded single-quote marks
    doubled).

    The default is none. Only superusers can change this setting.
    

    You want either ddl or all to be the selection. This is what you need to alter:
    In your data/postgresql.conf file, change the log_statement setting to ‘all’. Further the following may also need to be validated:

    1) make sure you have turned on the log_destination variable
    2) make sure you turn on the logging_collector
    3) also make sure that pg_log actually exists relative to your data directory, and that the postgres user can write to it.
    

    taken from here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have recently used an icon file received from our marketing team. The icon
I am working in a team and recently we have lost all of our
Our team recently upgraded to TeamCity 4.5.4 but we're having trouble with TeamCity running
Our team has recently been working on a logic and data layer for our
Our team has recently been considering pushing out a minor registry fix to users
I recently became part of a complex embedded project team for which I will
We have recently introduced version control in Subversion in our development cycle, and a
I have recently switched from a c# team to a vb.net team. One of
my team has made the decision recently to use Moq as our mocking framework
I have recently installed Team Explorer on one of my machines that has Visual

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.