Re: Keeping track of updates/performances

From: Andreas Kretschmer <akretschmer(at)spamfence(dot)net>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Keeping track of updates/performances
Date: 2015-03-17 08:50:56
Message-ID: 20150317085056.GA19798@tux
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Romain Billon-Grand <billongrand(at)hotmail(dot)fr> wrote:

> Hello!
>
> Please give me your advices about the best way to keep in each table those
> informations:
> name of the user who created a row
> name of the last user who modified it
> timestamp for creation
> timestamp for last modification
>
> 1/ I have been looking for built in options in postgres but I guess I have to
> build it myself...?
> Of course if Postgres already does it I am very happy, and all of the following
> quetsions are useless but I did not find this in the documentation...
>
> 2/ Is there some SQL query to return the "usermane" from pg_catalog or
> something

You can use TRIGGER for Insert/Update, the current user can you detect
with current_user.

Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect. (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly." (unknown)
Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889°

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Felipe Santos 2015-03-17 12:18:11 Re: Keeping track of updates/performances
Previous Message Romain Billon-Grand 2015-03-17 08:06:35 Keeping track of updates/performances