dbTalk Databases Forums  

Timestamp not working

comp.databases.postgresql.general comp.databases.postgresql.general


Discuss Timestamp not working in the comp.databases.postgresql.general forum.



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

Default Timestamp not working - 11-12-2005 , 09:47 AM






I have added a field to one of my PostgreSQL tables in the "Timestamp"
datatype, but when I add a row to that table I don't get the date and time
inserted into that column? Do I need to put a default value into the column
too?



Reply With Quote
  #2  
Old   
Stephen Prinster
 
Posts: n/a

Default Re: Timestamp not working - 11-12-2005 , 11:52 AM






Si wrote:
Quote:
I have added a field to one of my PostgreSQL tables in the "Timestamp"
datatype, but when I add a row to that table I don't get the date and time
inserted into that column? Do I need to put a default value into the column
too?


Yep. I haven't done this for a while, but if my memory serves me, you
need to use CURRENT_TIME, CURRENT_DATE, or CURRENT_TIMESTAMP as a
default value to populate the column. For more on these functions, see
the docs:

http://www.postgresql.org/docs/8.0/s...-datetime.html


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.