pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: BD Postgres <postgres@master.abrente.es>
To: Aleksey Dashevsky <postgres@luckynet.co.il>
To: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] sql date functions
Date: Mon, 06 Jul 1998 13:09:22 +0200
Message-ID: <35A0B062.F6BB8097@master.abrente.es> (raw)
References: <Pine.LNX.3.96.SK.980706135335.7452A-100000@kesha.luckynet.co.il>

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.




view thread (4+ messages)  latest in thread

Message-ID: <35A0B062.F6BB8097@master.abrente.es>
Permalink:  ../35A0B062.F6BB8097@master.abrente.es/
Also on:    postgresql.org/message-id/35A0B062.F6BB8097@master.abrente.es

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: postgres@master.abrente.es, postgres@luckynet.co.il
  Subject: Re: [SQL] sql date functions
  In-Reply-To: <35A0B062.F6BB8097@master.abrente.es>
  References: <Pine.LNX.3.96.SK.980706135335.7452A-100000@kesha.luckynet.co.il> <35A0B062.F6BB8097@master.abrente.es>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox