Re: Row creation time

From: Michael Glaesemann <grzm(at)myrealbox(dot)com>
To: "Najib Abi Fadel" <nabifadel(at)usj(dot)edu(dot)lb>
Cc: "generalpost" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Row creation time
Date: 2004-11-24 10:40:54
Message-ID: 511D308E-3E05-11D9-A6F6-000A95C88220@myrealbox.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Nov 24, 2004, at 7:07 PM, Najib Abi Fadel wrote:

> Is there a to get the row creation time if we know it's object ID ??

Only if you have a timestamp column on the table that records the
creation time. For example,

create table foo (
foo_id serial not null unique
, created_timestamp timestamptz not null
default current_timestamp
) without oids;

Some people also like to include a modified_timestamp column, which can
easily be updated via an after update trigger.

hth

Michael Glaesemann
grzm myrealbox com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Najib Abi Fadel 2004-11-24 10:47:27 Re: Row creation time
Previous Message Net Virtual Mailing Lists 2004-11-24 10:36:57 Re: Creating index on a view?