Search Postgresql Archives

Re: Determining when a row was inserted

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Reply at bottom...

On Fri, 2005-06-03 at 12:53, Wiebe de Jong 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@xxxxxxxxxxxxxx
> [mailto:pgsql-general-owner@xxxxxxxxxxxxxx] On Behalf Of Terry Lee Tucker
> Sent: Thursday, June 02, 2005 5:51 AM
> To: pgsql-general@xxxxxxxxxxxxxx
> Subject: Re:  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.

There are plenty of examples of a trigger to do this so that ANY time
the row is updated, or when it's inserted, the timestamp gets updated to
now() or timeofday.

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux