What is the PostgreSQL equivalent of MSSQL CONTEXT_INFO?

In connection with my other question, "What is the best way to check DELETE logs?" . What is the PostgreSQL equivalent for CONTEXT_INFO?

[EDIT]

I want the log to be deleted using a trigger, but since I do not use the database user as my logical user for the application, I cannot register CURRENT_USER from the startup code as the user who deleted the entry. But for INSERT and UPDATE, you can record record changes from a trigger, since you can simply add a user field to records, for example insert_by and last_updated_by, and use these fields to enter the audit table.

+3
source share
1 answer

http://www.postgres.cz/index.php/PostgreSQL_SQL_Tricks_II#Any_other_session_variables

PostgreSQL provides more options, please take a look at this site.

+4
source

Source: https://habr.com/ru/post/1705550/


All Articles