Re: [SQL] sql date functions

From: BD Postgres <postgres(at)master(dot)abrente(dot)es>
To: Aleksey Dashevsky <postgres(at)luckynet(dot)co(dot)il>, pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] sql date functions
Date: 1998-07-06 11:09:22
Message-ID: 35A0B062.F6BB8097@master.abrente.es
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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.

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Aleksey Dashevsky 1998-07-06 11:26:22 Re: [SQL] sql date functions
Previous Message BD Postgres 1998-07-06 10:14:29 sql date functions