From: BD Postgres <postgres@master.abrente.es>
To: pgsql-sql@postgresql.org
Subject: sql date functions
Date: Mon, 06 Jul 1998 12:14:29 +0200
Message-ID: <35A0A385.BE14761A@master.abrente.es> (raw)
Hello,
I am new to postgress and SQL and I don't know how to use the date
functions:
I need to insert two dates in a row, the first been a week before the
second but I don't know how this can be achieved, I have tried:
insert into table1 (date1,date2) values('1997-2-3::date','1997-2-3::date
+ timespan(1 week)');
that is what I think that should be, and all the variations I have
imagined, but it hasn't worked, I'm doing this from perl with the DBI
interface, but I don't think that to precompute the second date first in
perl is a good idea, I prefer to let postgress do it if possible.
the errors reported by postmaster are like this:
ERROR: Bad date external representation 1/2/2003::date + timespan(1
week)
Could somebody tell me which is the correct way to get this working ?
Thank you.
- Salvador FandiƱo.
P.S. I have previusly posted this msg in the NOVICE mailing list, but
nobody seems to know how to do it there.
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
Subject: Re: sql date functions
In-Reply-To: <35A0A385.BE14761A@master.abrente.es>
References: <35A0A385.BE14761A@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