Re: at time zone question in pl/pgSQL

From: "Gregory Wood" <gregw(at)com-stock(dot)com>
To: "Heather Grace" <heather(at)radiovoodoo(dot)com>
Cc: "PostgreSQL-General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: at time zone question in pl/pgSQL
Date: 2002-02-18 21:08:39
Message-ID: 041101c1b8c0$8683c9e0$7889ffcc@comstock.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> I'm trying to write a simple pl/pgsql function that will return the
current time for the given time zone ( i have to deal multiple time zones) .
But I don't seem to be using the appropriate syntax. I keep getting an
error on the 'at time zone...'

> DECLARE
> new_time TIMESTAMP;
> BEGIN
> SELECT INTO new_time now() at time zone 'PST'; /*just hard coding the
time zone for now */
> return new_time;
> END;

Assuming that this is a direct cut and paste, the error would appear to be
that the single quotes around the timezone are not escaped. Try changing
that line to:

SELECT INTO new_time now() at time zone ''PST''; /*just hard coding the
time zone for now */

If that's not it, nevermind :)

Greg

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Command Prompt, Inc. 2002-02-18 21:14:48 PgManage update
Previous Message Dannyl@barak.net.il 2002-02-18 20:58:28 Re: Hebrew support