Search Postgresql Archives

Including SQL files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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)

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.

Is there such a thing for PostgreSQL 9.5.1 available please and if not - could you share your approaches here?

The "EXEC SQL INCLUDE" described at http://www.postgresql.org/docs/9.5/static/ecpg-preproc.html seems to be something different?

Regards
Alex


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux