Re: Problems with PLPGSQL

From: Pavel Stehule <stehule(at)kix(dot)fsv(dot)cvut(dot)cz>
To: Alex <alex(at)meerkatsoft(dot)com>
Cc: Richard Huxton <dev(at)archonet(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Problems with PLPGSQL
Date: 2003-11-06 10:39:25
Message-ID: Pine.LNX.4.44.0311061138001.2031-100000@kix.fsv.cvut.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello

Don't use now or current_time, use
LOCALTIMESTAMP

CURRENT_TIME and CURRENT_TIMESTAMP deliver values with time zone;
LOCALTIME and LOCALTIMESTAMP deliver values without time zone.

Pavel

On Thu, 6 Nov 2003, Alex wrote:

> Hi Richard,
> as for the timestamp, both ways work fine, but the other problem still
> exists. using a
> ''60 Min'' works just fine, but WHERE job_end + ($1::text || '' Min'' )
> > now
> does not. job_end is timestamp without tz
>
> Alex
>
> Richard Huxton wrote:
>
> >On Thursday 06 November 2003 04:13, Alex wrote:
> >
> >
> >>Hi,
> >>I have a problem with quoting in one of my functions:
> >>
> >>now TIMESTAMP := ''now'';
> >>
> >>
> >
> >Your main question has been answered, but you might want now() rather than
> >''now''. Off the top of my head, I think the ''now'' might get compiled as a
> >value on the first run and stay at that value.
> >
> >
> >
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2003-11-06 10:59:18 Re: INSERT and UPDATE of ALLBALLS/INFINITY dates and MOVE
Previous Message Alex 2003-11-06 10:00:59 Re: Problems with PLPGSQL