Re: [SQL] sql date functions

BD Postgres <postgres@master.abrente.es>

From: BD Postgres <postgres@master.abrente.es>
To: Aleksey Dashevsky <postgres@luckynet.co.il>, pgsql-sql@postgreSQL.org
Date: 1998-07-06T11:09:22Z
Lists: 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.