I want the time zone if a function a bit like ...
CREATE OR REPLACE FUNCTION
short_name (timestamp with time zone, varchar) RETURNS varchar AS $$
DECLARE
...
BEGIN
SET LOCAL TIME ZONE $2;
SELECT to_char($1, 'TZ')::varchar
...
END $$
LANGUAGE 'plpgsql' VOLATILE;
But as written is doesn't compile complaining about the "naked" $2. If I quote
the $2 it sets the time zone to $2 literally (I didn't know you could do that,
but that's another issue). Escaping the quotes either as \' or '' doesn't compile.
Help.
Steve