dbTalk Databases Forums  

[BUGS] Default Timestamp 'Now' bug with 7.4 on Panther.

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] Default Timestamp 'Now' bug with 7.4 on Panther. in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Harry Hochheiser
 
Posts: n/a

Default [BUGS] Default Timestamp 'Now' bug with 7.4 on Panther. - 02-15-2004 , 12:06 PM







Running Postgres 7.4 on Panther, there seems to be a problem with
setting a timestamp column to have a default of 'now':

createdb test

create table bar (date timestamp DEFAULT 'now');
insert into bar DEFAULT VALUES;
insert into bar DEFAULT VALUES;
insert into bar DEFAULT VALUES;
insert into bar DEFAULT VALUES;

select * from BAR;


output:

date
----------------------------
2004-02-12 15:17:38.838411
2004-02-12 15:17:38.838411
2004-02-12 15:17:38.838411
2004-02-12 15:17:38.838411

All rows have the same timestamp, as if 'now' was interpreted at the
time of table creation, not at the time of insertion.

thanks,

Harry

Harry Hochheiser, Ph.D.
Image Informatics and Computational Biology Unit
Laboratory of Genetics
NIH, National Institute on Aging
333 Cassell Drive
Suite 3000
Baltimore MD 21224
410 558 8046


---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] Default Timestamp 'Now' bug with 7.4 on Panther. - 02-15-2004 , 05:47 PM






Harry Hochheiser <hsh (AT) nih (DOT) gov> writes:
Quote:
Running Postgres 7.4 on Panther, there seems to be a problem with
setting a timestamp column to have a default of 'now':
There was an intentional change of behavior --- see the release notes.
The supported way to do this is to use CURRENT_TIMESTAMP or now() as
the column default.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly


Reply With Quote
  #3  
Old   
Harry Hochheiser
 
Posts: n/a

Default Re: [BUGS] Default Timestamp 'Now' bug with 7.4 on Panther. - 02-17-2004 , 12:12 PM




Ok, thanks. that's what i get for using a premade package, I guess.

-harry

On Feb 15, 2004, at 1:31 PM, Tom Lane wrote:

Quote:
Harry Hochheiser <hsh (AT) nih (DOT) gov> writes:
Running Postgres 7.4 on Panther, there seems to be a problem with
setting a timestamp column to have a default of 'now':

There was an intentional change of behavior --- see the release notes.
The supported way to do this is to use CURRENT_TIMESTAMP or now() as
the column default.

regards, tom lane


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org)


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.