Thread: Functions receiving argument of type timezone.

Functions receiving argument of type timezone.

From
Joshua Moore-Oliva
Date:
The problem I am having is that a function with the definition

loctolisttime(timestamp, interval, integer)

When I attempt to call that function with

timestamp 'now' AT TIME ZONE interval '0 hours'  (I need to pass the current
time at gmt) I get the error.

ERROR: Function loctolisttime(timestamp with time zone, interval, integer)
does not exist Unable to identify a function that satisfies the given
argument types You may need to add explicit typecasts

when I pass it an argument from a field of a table which is of type timestamp,
it works fine...

any idea how I can get a UTC timestamp into that function?

Josh.

Re: Functions receiving argument of type timezone-- more info

From
Joshua Moore-Oliva
Date:
A list of possible solutions that I cna't figure out how to do..

a) Is there a way to declare a function accepting an argument of type
"timestamp with time zone"?

b) Is there a special function like utc_now, or CURRENT_UTC_TIMESTAMP or
something I could pass to the function?

Josh.



Re: Functions receiving argument of type timezone-- more

From
Stephan Szabo
Date:
On Thu, 13 Mar 2003, Joshua Moore-Oliva wrote:

> A list of possible solutions that I cna't figure out how to do..
>
> a) Is there a way to declare a function accepting an argument of type
> "timestamp with time zone"?

You should just be able to declare the function saying the argument is
timestamp with time zone afaics.  I tried in in 7.3.1 and 7.4 devel.