Where can I find my PLPython functions in Postgres?

I created some functions in a specific circuit, but the Functions section has nothing inside.

I am creating functions similar to this example:

CREATE FUNCTION pymax (a integer, b integer) RETURNS integer AS $$ if a > b: return a return b $$ LANGUAGE plpythonu; 
0
source share
1 answer

If the name does not match the schema criteria, a function is created in your current schema (for example, other objects). The current schema is determined by the current search_path setting.

To see the current search_path :

 SHOW search_path; 

There are several ways to set search_path , more in this related answer:
How affects the identifier of the search identifier and the "current scheme"

To find out if there is any function with a similar name in your database:

 SELECT n.nspname, p.proname, pg_get_function_arguments(p.oid) As args FROM pg_proc p JOIN pg_namespace n ON n.oid = p.pronamespace WHERE p.proname ILIKE '%pymax%'; 

If nothing is found, functions in this database do not exist. Perhaps you created it in another db by mistake?

+1
source

Source: https://habr.com/ru/post/981743/


All Articles