79685676

Date: 2025-07-01 07:37:21
Score: 0.5
Natty:
Report link

Thanks for the help. Adrian's answer is probably the best, most secure way to fix the problem, but I found another solution that avoids explicitly citing a schema (one reason I wanted this is that I wanted code that would install the functions in the current user's schema without explicitly stating who that user is):

CREATE OR REPLACE FUNCTION nest_myfunc(
       ts_array TIMESTAMP WITHOUT TIME ZONE[],tz text)
       RETURNS float[] AS
$BODY$
SELECT myfunc($1,$2);
$BODY$ LANGUAGE 'sql' IMMUTABLE
SET search_path FROM CURRENT;

This explicitly sets the search_path to be the same as the one at the time of function creation when running the function.

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: David M. Kaplan