Re: [GENERAL] keeping track of date - Mailing list pgsql-general

From Ed Loehr
Subject Re: [GENERAL] keeping track of date
Date
Msg-id 3880A4E9.B1604F20@austin.rr.com
Whole thread Raw
In response to keeping track of date  (admin <admin@wtbwts.com>)
List 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


pgsql-general by date:

Previous
From: "Oliver Elphick"
Date:
Subject: Re: [GENERAL] New To List
Next
From: Palle Girgensohn
Date:
Subject: What's this: OID IS INVALID. TUPGONE 0.