Re: [GENERAL] keeping track of date

From: Ed Loehr <eloehr(at)austin(dot)rr(dot)com>
To: admin <admin(at)wtbwts(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] keeping track of date
Date: 2000-01-15 16:48:41
Message-ID: 3880A4E9.B1604F20@austin.rr.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

admin wrote:

> What would be the recommended way to keep track of the date/time a tuple
> was inserted?
>
> Should I be using triggers on insert, or is there an internal variable I
> can use to avoid creating another field?

Here's how I'm doing it:

CREATE TABLE mytable (
...
creation_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);

Cheers,
Ed Loehr

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Palle Girgensohn 2000-01-15 16:59:04 What's this: OID IS INVALID. TUPGONE 0.
Previous Message yura 2000-01-15 11:49:09 Re[2]: [GENERAL] case-insensitive like operator