Hi
2016-03-21 15:42 GMT+01:00 Alexander Farber <alexander.farber@xxxxxxxxx>:
Is there such a thing for PostgreSQL 9.5.1 available please and if not - could you share your approaches here?I would prefer to have every stored function in a separate file (which would make reading git history easier too) and include them from words.sql.Hello fellow pgsql users,I am programming a word game backend in PL/pgSQL and have already reached a point, where (too) many stored functions are declared in a single file words.sql:
# SELECT proname || '(' || oidvectortypes(proargtypes) || ')'
FROM pg_proc INNER JOIN pg_namespace ns ON (pg_proc.pronamespace = ns.oid)
WHERE ns.nspname = 'public' ORDER BY proname;
?column?
-----------------------------------------------------------------
test1(integer)
words_hash(character varying)
words_join_new_game(integer, integer)
words_merge_users(jsonb, inet)
words_paying_user(integer)
words_play(integer, integer, jsonb)
words_shuffle(character varying[])
words_skip_game(integer, integer)
words_surrender_game(integer, integer)
words_swap_game(integer, integer, character varying)
words_trigger()
words_valid_user(integer, character varying, character varying)
(12 rows)
why you need it?
I developed large plpgsql application, and I used more than thirty files fit plpgsql functions. For deployment I had prepared Makefile. One file holds one schema usually.
Regards
Pavel
AlexRegardsThe "EXEC SQL INCLUDE" described at http://www.postgresql.org/docs/9.5/static/ecpg-preproc.html seems to be something different?