Re: [SQL] sql date functions - Mailing list pgsql-sql

From BD Postgres
Subject Re: [SQL] sql date functions
Date
Msg-id 35A0B062.F6BB8097@master.abrente.es
Whole thread Raw
Responses Re: [SQL] sql date functions
List 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 by date:

Previous
From: BD Postgres
Date:
Subject: sql date functions
Next
From: Aleksey Dashevsky
Date:
Subject: Re: [SQL] sql date functions