Re: [7.3.x] function does not exist ... ? - Mailing list pgsql-hackers

From Gaetano Mendola
Subject Re: [7.3.x] function does not exist ... ?
Date
Msg-id 3FAFEF44.2090108@bigfoot.com
Whole thread Raw
In response to [7.3.x] function does not exist ... ?  ("Marc G. Fournier" <scrappy@postgresql.org>)
Responses Re: [7.3.x] function does not exist ... ?  ("Marc G. Fournier" <scrappy@postgresql.org>)
List pgsql-hackers
Marc G. Fournier wrote:

> 'k, this doesn't look right, but it could be that I'm overlooking
> something ...
> 
> The function I created:
> 
> CREATE FUNCTION month_trunc (timestamp without time zone) RETURNS timestamp without time zone
>     AS 'SELECT date_trunc(''month'', $1 )'
>     LANGUAGE sql IMMUTABLE;
> 
> 
> The query that fails:
> 
> ams=# select * from traffic_logs where month_trunc(runtime) = month_trunc(now());
> ERROR:  Function month_trunc(timestamp with time zone) does not exist
>         Unable to identify a function that satisfies the given argument types
>         You may need to add explicit typecasts

now return a timestamp with time zone and your function
take a timestamp without time zone.                 ^^^^^^^


Regards
Gaetano Mendola



pgsql-hackers by date:

Previous
From: "Marc G. Fournier"
Date:
Subject: [7.3.x] function does not exist ... ?
Next
From: Andrew Dunstan
Date:
Subject: Re: [7.3.x] function does not exist ... ?