Re: Datetime operators (was: Re: [SQL] Another Date question)

Поиск
Список
Период
Сортировка
От
Тема Re: Datetime operators (was: Re: [SQL] Another Date question)
Дата
Msg-id Pine.LNX.4.10.9912031336300.13298-100000@picasso.realtyideas.com
обсуждение исходный текст
Ответ на Re: Datetime operators (was: Re: [SQL] Another Date question)  (Thomas Lockhart <lockhart@alumni.caltech.edu>)
Ответы Re: Datetime operators (was: Re: [SQL] Another Date question)  (Andy Lewis <alewis@roundnoon.com>)
Re: Datetime operators (was: Re: [SQL] Another Date question)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
why 

create table mymy (mydate datetime default (now() + '60 days'::timespan )); 

does not work?

On Fri, 3 Dec 1999, Thomas Lockhart wrote:

> > > I'd like to create a table with a datetime field that defaults to +60
> > > days.
> > > mydate datetime default 'now() +@60 days',
> > > ...
> > Where is a problem?
> 
> You have enclosed your default values into a large string, rather than
> letting them be evaluated as an expression:
> 
>   mydate datetime default (now() + '60 days')
> 
> where the outer parens are optional.
> 
> >      datetime + '10 day' or
> >      datetime + '2 year' ..etc.
> > But I'm not sure what is better or exists it in other SQL.
> 
> afaik this is the simplest and most direct way to do it. Note that you
> can include other timespan fields in the constant:
> 
>   mydate datetime default (now() + '60 days 10 hours')
> 
> HTH
> 
>                       - Thomas
> 
> -- 
> Thomas Lockhart                lockhart@alumni.caltech.edu
> South Pasadena, California
> 
> ************
> 



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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [SQL] Howto to force NULL rows at the bottom ?
Следующее
От:
Дата:
Сообщение: Re: Datetime operators (was: Re: [SQL] Another Date question)