Re: Internal time stamps?

Поиск
Список
Период
Сортировка
От Brian Modra
Тема Re: Internal time stamps?
Дата
Msg-id 5a9699850911241112j7d7ae45cqd9f69537bd0243ab@mail.gmail.com
обсуждение исходный текст
Ответ на Internal time stamps?  (niccguard-dev@yahoo.com)
Список pgsql-novice
2009/11/24  <niccguard-dev@yahoo.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/

В списке pgsql-novice по дате отправления:

Предыдущее
От: niccguard-dev@yahoo.com
Дата:
Сообщение: Internal time stamps?
Следующее
От: Josh Kupershmidt
Дата:
Сообщение: Re: Bit count