Re: [GENERAL] How do I make a timestamp column default to current time

2006-03-16 Thread Bruce Momjian
Tom Lane wrote: > "John D. Burger" <[EMAIL PROTECTED]> writes: > >> mycol timestamp default now() > >> or > >> mycol timestamp default current_timestamp > > > And both of these return start time of the current transaction, yes? > > Is it the case that there is no SQL-standard way to get the curr

Re: [GENERAL] How do I make a timestamp column default to current time

2006-03-16 Thread Tom Lane
"John D. Burger" <[EMAIL PROTECTED]> writes: >> mycol timestamp default now() >> or >> mycol timestamp default current_timestamp > And both of these return start time of the current transaction, yes? > Is it the case that there is no SQL-standard way to get the current > time? AFAIK the spec d

Re: [GENERAL] How do I make a timestamp column default to current time

2006-03-16 Thread John D. Burger
Tom Lane writes: Try mycol timestamp default now() or mycol timestamp default current_timestamp (the latter is actually a function call, even though the SQL standard says it has to be spelled without any parentheses) And both of these return start time of the current transact

Re: [GENERAL] How do I make a timestamp column default to current time

2006-03-16 Thread Tom Lane
"zagman" <[EMAIL PROTECTED]> writes: > I'm setting up a simple timecard program and I need a column that > defaults to the current time when a new row is inserted. How can I do > this I tried setting the default to 'now' but all that does is put the > time I created the table in each row! The defa

Re: [GENERAL] How do I make a timestamp column default to current time

2006-03-16 Thread William ZHANG
"zagman" <[EMAIL PROTECTED]> > > Hi, > > I'm setting up a simple timecard program and I need a column that > defaults to the current time when a new row is inserted. How can I do > this I tried setting the default to 'now' but all that does is put the > time I created the table in each row! I'm al