Re: Determining when a row was inserted

From: Alex Turner <armtuk(at)gmail(dot)com>
To: Wiebe de Jong <wiebedj(at)shaw(dot)ca>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Determining when a row was inserted
Date: 2005-06-03 18:40:08
Message-ID: 33c6269f05060311406b15c245@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

One might even suggest that this should really be a default for all tables
everywhere, because at some time or another, someone wants to know when
something got put in the database...

Alex.

On 6/3/05, Wiebe de Jong <wiebedj(at)shaw(dot)ca> wrote:
>
> The way I do it is to add a timestamp field with a default value of now().
> Unfortunately, this won't help with any records that have already been
> created.
>
> Wiebe
>
> -----Original Message-----
> From: pgsql-general-owner(at)postgresql(dot)org
> [mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of Terry Lee Tucker
> Sent: Thursday, June 02, 2005 5:51 AM
> To: pgsql-general(at)postgresql(dot)org
> Subject: Re: [GENERAL] Determining when a row was inserted
>
> I don't think there is a way to do that. You'll have to create an audit
> table
> and a rule to update it or you'll have to add a column to the table and a
> trigger to update it.
>
> On Thursday 02 June 2005 01:22 am, Eisenhut, Glenn saith:
> > Folks - hi
> >
> > Is it possible to determine when a row was inserted into a table using
> the
> > system catalogs or such. I have the situation where I need to find out
> when
> > a user was added to a user table - the table was not setup with a date
> to
> > track this.
> >
> > Thanks
> > Glenn
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2005-06-03 18:53:21 Re: Determining when a row was inserted
Previous Message Wiebe de Jong 2005-06-03 17:53:08 Re: Determining when a row was inserted