I'm trying to create the following function into my Postgres database:
create or replace function public.extract_hour(time_param timestamp with time zone) returns double precision language sql as $function$
SELECT EXTRACT(hour from timestamp time_param);
$function$;
but I get the following error:
ERROR: syntax error at or near "time_param"
I tried to put instead of time_param $0, but the same error occur. Can somebody explain me how to solve that?