Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-bugs by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group