Re: [SQL] The date of an entry?

From: Michael J Schout <mschout(at)gkg(dot)net>
To: Johann Spies <jhspies(at)alpha(dot)futurenet(dot)co(dot)za>
Cc: Postgres-poslys <pgsql-sql(at)postgreSQL(dot)org>
Subject: Re: [SQL] The date of an entry?
Date: 1998-07-11 16:15:43
Message-ID: 35A78FAF.8D6E54AF@gkg.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Johann Spies wrote:
>
> Is there a system field that can enable me to determine when an entry into
> the database was made? I see a reference to 'abstime'. How can that be
> accessed?

Abstime is a column type, just like datetime, date, or even int for that
matter. Once upon a time, there used to be "time travel" in postgreSQL
so every row had a tmin,tmax field in it that would show the last time
the row was updated, but they are no longer available as time travel
was removed in the interest of efficiency. You can get the same effect
by creating your own timestamp column though:

create table foo (ts timestamp default now(), f1 int);
insert into foo (f1) values (12345);
select * from foo;

ts | f1
----------------------+-----
1998-07-11 11:10:37-05|12345
(1 row)

Regards,
Mike

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Herouth Maoz 1998-07-12 11:03:56 RE: [SQL] Single vs. multiple indexes
Previous Message Jeff Brown 1998-07-11 15:58:04 help with join