Re: [GENERAL] Determining when a row was inserted

2005-06-05 Thread Patrick TJ McPhee
In article <[EMAIL PROTECTED]>, Alex Turner <[EMAIL PROTECTED]> wrote: % I really wasn't suggesting it be put in the table structure at the DB level, % more a sidebar suggestion for people building schemas for companies. I can't % count the number of times I've been asked when something was inse

Re: [GENERAL] Determining when a row was inserted

2005-06-03 Thread Greg Stark
Tom Lane <[EMAIL PROTECTED]> writes: > As it happens, the original Berkeley-era Postgres did indeed add > creation and deletion timestamps to every row, as part of their "time > travel" feature. That got ripped out very soon after the code left > Berkeley, because the overhead was just unaccepta

Re: [GENERAL] Determining when a row was inserted

2005-06-03 Thread Alex Turner
I really wasn't suggesting it be put in the table structure at the DB level, more a sidebar suggestion for people building schemas for companies.  I can't count the number of times I've been asked when something was inserted and we didn't have an answer for the question.  Wouldn't it be nice for a

Re: [GENERAL] Determining when a row was inserted

2005-06-03 Thread Alex Turner
Subject: Re: [GENERAL] Determining when a row was inserted   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 bee

Re: [GENERAL] Determining when a row was inserted

2005-06-03 Thread Tom Lane
Scott Marlowe <[EMAIL PROTECTED]> writes: > On Fri, 2005-06-03 at 13:40, Alex Turner wrote: >> 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... > That kind o

Re: [GENERAL] Determining when a row was inserted

2005-06-03 Thread Scott Marlowe
iday, June 03, 2005 11:55 AM > To: Wiebe de Jong > Cc: pgsql-general@postgresql.org > Subject: Re: [GENERAL] Determining when a row was inserted > > > > > Reply at bottom... > > On Fri, 2005-06-03 at 12:53, Wiebe de Jong wrote: > > The way I do it is to add a

Re: [GENERAL] Determining when a row was inserted

2005-06-03 Thread Wiebe de Jong
Title: Re: [GENERAL] Determining when a row was inserted I don't use this for all tables, only the ones with important information in them, like people, accounts, etc.   I actually have two fields, tsCreated and tsUpdated, both which default to now(). When I do an update, I set the

Re: [GENERAL] Determining when a row was inserted

2005-06-03 Thread Martijn van Oosterhout
> On 6/3/05, Wiebe de Jong <[EMAIL PROTECTED]> 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. On Fri, Jun 03, 2005 at 02:40:08PM -0400, Alex Turner wrote: > One might

Re: [GENERAL] Determining when a row was inserted

2005-06-03 Thread Scott Marlowe
> Wiebe > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Terry > Lee Tucker > Sent: Thursday, June 02, 2005 5:51 AM > To: pgsql-general@postgresql.org > Subj

Re: [GENERAL] Determining when a row was inserted

2005-06-03 Thread Scott Marlowe
- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Terry Lee Tucker > Sent: Thursday, June 02, 2005 5:51 AM > To: pgsql-general@postgresql.org > Subject: Re: [GENERAL] Determining when a row was inserted > > I don't think there is a way to do that. You

Re: [GENERAL] Determining when a row was inserted

2005-06-03 Thread Alex Turner
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 <[EMAIL PROTECTED]> wrote: The way I do it is to add a timestamp field with a defaul

Re: [GENERAL] Determining when a row was inserted

2005-06-03 Thread Wiebe de Jong
ne 02, 2005 5:51 AM To: pgsql-general@postgresql.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.

Re: [GENERAL] Determining when a row was inserted

2005-06-02 Thread Terry Lee Tucker
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 inse

Re: [GENERAL] Determining when a row was inserted

2005-06-02 Thread Bruno Wolff III
On Thu, Jun 02, 2005 at 06:22:01 +0100, "Eisenhut, Glenn" <[EMAIL PROTECTED]> wrote: > > > 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 > ta

[GENERAL] Determining when a row was inserted

2005-06-02 Thread Eisenhut, Glenn
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 **