AT TIME ZONE INTERVAL and prepared statements

From: Kris Jurka <books(at)ejurka(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: AT TIME ZONE INTERVAL and prepared statements
Date: 2004-10-22 22:08:55
Message-ID: Pine.BSO.4.56.0410221702490.18299@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


AT TIME ZONE INTERVAL $1 doesn't seem to be supported in prepared
statements.

This works:

SELECT now() AT TIME ZONE INTERVAL '-08:00';

This doesn't:

PREPARE mys(text) AS SELECT now() AT TIME ZONE INTERVAL $1;
ERROR: syntax error at or near "$1" at character 57

These work:

PREPARE mys(interval) AS SELECT now() AT TIME ZONE $1;
PREPARE mys(text) AS SELECT now() AT TIME ZONE ($1::interval)

Any reason why the second case doesn't work?

Kris Jurka

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2004-10-22 22:16:04 Re: AT TIME ZONE INTERVAL and prepared statements
Previous Message Enrico Riedel 2004-10-22 21:27:48 Beta3 much slower than Beta2