create table and default 'now' problem ?

Поиск
Список
Период
Сортировка
От Oleg Bartunov
Тема create table and default 'now' problem ?
Дата
Msg-id Pine.GSO.3.96.SK.990921014729.24490A-100000@ra
обсуждение исходный текст
Список pgsql-hackers
Hi,

how I could create table with datetime field default to 'now'::text in 
a way Jan did in his shoes rule example ?

If I do:
test=> create table test ( a datetime default 'now', b int4);
CREATE
test=> insert into test (b) values (1);
INSERT 1677899 1
test=> insert into test (b) values (2);
INSERT 1677900 1
test=> select * from test;
a                           |b
----------------------------+-
Tue 21 Sep 01:48:27 1999 MSD|1
Tue 21 Sep 01:48:27 1999 MSD|2
(2 rows)

I always get datetime of the moment I created the table, but I'd like
to have datetime of moment I insert. 
Regards,
    Oleg

_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83



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

Предыдущее
От: The Hermit Hacker
Дата:
Сообщение: Re: [HACKERS] Command Locations (was Re: HISTORY for 6.5....)
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] pgaccess seems a tad confused]