Re: Calculation error - Mailing list pgsql-novice

From Wil Duis
Subject Re: Calculation error
Date
Msg-id 3EDDBA8A.EE124642@asml.nl
Whole thread Raw
In response to Calculation error  (Wil Duis <Wil.Duis@asml.com>)
List pgsql-novice
Hi Tom
Sorry for my delayed reaction, but I didn't have much time yesterday.

On a trial and error way I tried a lot of variations, but up to now without success;
The closest to succes (I guess) was by using the following syntax:

v_startmoment := ''timestamp(''||p_start_date||'', ''||p_start_time||'')'';
but this resulted in error:
ERROR:  Bad timestamp external representation 'timestamp(2003-05-14, 01:20:40)'

This supprised me since executing from commandline:
   select timestamp'2003-05-10 01:20:40';
works fine!


So, all suggestions are still welcome.

Regards:  Wil


Tom Lane wrote:

>
> The function name "timestamp" needs to be double quoted here to avoid a
> syntax conflict with the type declaration syntax TIMESTAMP(n).  But
> actually I'd use timestamptz, assuming that your dates and times are in
> local time --- the above calculation will give the wrong answers across
> a daylight-savings transition.
>



pgsql-novice by date:

Previous
From: Aarni Ruuhimäki
Date:
Subject: locale support
Next
From: Jeff Eckermann
Date:
Subject: Re: FATAL 1