From: a <372660931@qq.com>
To: pgsql-general <pgsql-general@postgresql.org>
Subject: Is it possible to get username information while writing trigger?
Date: Mon, 7 May 2018 15:39:37 +0800
Message-ID: <tencent_5889CA742370FDD1149BA470@qq.com> (raw)
Hey:
What I want is to add a log entry at the last column of each row, which will record the history update, insert automatically when relative statement is processed.
I have read the documentation on triggers, which helps a lot. However, I may have few more extra requirement to complete my wishes:
1, I would like to get the username of who executed the statement;
2, I would like to get the column name that is being updated;
If it is possible and how should I do it??
Thanks a lot!
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: 372660931@qq.com
Subject: Re: Is it possible to get username information while writing trigger?
In-Reply-To: <tencent_5889CA742370FDD1149BA470@qq.com>
References: <tencent_5889CA742370FDD1149BA470@qq.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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