Re: Internal time stamps?

From: Brian Modra <epailty(at)googlemail(dot)com>
To: niccguard-dev(at)yahoo(dot)com
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Internal time stamps?
Date: 2009-11-24 19:12:36
Message-ID: 5a9699850911241112j7d7ae45cqd9f69537bd0243ab@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

2009/11/24 <niccguard-dev(at)yahoo(dot)com>:
> Does postgresql have any kind of internal time stamps for a table entry?  I
> can create a field that is 'timestamp' and store it there, I was just
> wondering if it was already done internally.  I'd hate to duplicate
> something it already does. :-)
> If it does store it internally, how do you access it?
> Thanks!!
> Aaron

KarooDB=> create table test ( ts timestamp with time zone default
now(), val text );
CREATE TABLE
KarooDB=> insert into test(val)values('123');
INSERT 0 1
KarooDB=> insert into test(val)values('456');
INSERT 0 1
KarooDB=> insert into test(val)values('abc');
INSERT 0 1
KarooDB=> insert into test(val)values('def');
INSERT 0 1
KarooDB=> select * from test;
ts | val
-------------------------------+-----
2009-11-24 21:11:44.969748+02 | 123
2009-11-24 21:11:49.913951+02 | 456
2009-11-24 21:11:54.441703+02 | abc
2009-11-24 21:11:57.529687+02 | def
(4 rows)

KarooDB=>

--
Brian Modra Land line: +27 23 5411 462
Mobile: +27 79 69 77 082
5 Jan Louw Str, Prince Albert, 6930
Postal: P.O. Box 2, Prince Albert 6930
South Africa
http://www.zwartberg.com/

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Josh Kupershmidt 2009-11-24 19:14:51 Re: Bit count
Previous Message niccguard-dev 2009-11-24 19:01:25 Internal time stamps?