Re: [SQL] sql date functions

Поиск
Список
Период
Сортировка
От BD Postgres
Тема Re: [SQL] sql date functions
Дата
Msg-id 35A0B062.F6BB8097@master.abrente.es
обсуждение исходный текст
Ответы Re: [SQL] sql date functions  (Aleksey Dashevsky <postgres@luckynet.co.il>)
Список pgsql-sql
Aleksey Dashevsky wrote:

> I think you need to rewrite this query with something like:
>
> insert into table1 (date1,date2) values('1997-2-3'::date,'1997-2-3'::date
>  + '1 week'::timespan);
>
> You can also use standard SQL-92 syntax for type casting, e.x.:
> cast ('1 week' as timespan )
>  etc.


You are right, but now postgres is reporting me that there is no '+' operator
defined for time and timespan, but I have found that I can add integers to
dates and they are threaded as days so I can solve my problem easily.

Thank you very much!

  - Salva.


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

Предыдущее
От: BD Postgres
Дата:
Сообщение: sql date functions
Следующее
От: Aleksey Dashevsky
Дата:
Сообщение: Re: [SQL] sql date functions