add create function scripts

This commit is contained in:
Paul Trowbridge 2018-02-08 17:40:23 -05:00
parent dc973690cb
commit d51a327868
2 changed files with 21 additions and 2 deletions

15
functions/srce_edit.pgsql Normal file
View File

@ -0,0 +1,15 @@
CREATE OR REPLACE FUNCTION tps.srce_set(_name text, _defn jsonb) RETURNS jsonb
AS $f$
BEGIN
/*
1. determine if insert or update
2. if update, determine if conflicts exists
3. do merge
*/
END;
$f$
LANGUAGE plpgsql

View File

@ -1,6 +1,6 @@
\timing \timing
DROP FUNCTION tps.srce_import(_path text, _srce text);
CREATE OR REPLACE FUNCTION tps.srce_edit(_path text, _srce text) RETURNS text CREATE OR REPLACE FUNCTION tps.srce_import(_path text, _srce text) RETURNS jsonb
/*-------------------------------------------------------- /*--------------------------------------------------------
0. load target import to temp table 0. load target import to temp table
@ -11,6 +11,10 @@ CREATE OR REPLACE FUNCTION tps.srce_edit(_path text, _srce text) RETURNS text
5. insert summary to log table 5. insert summary to log table
*/--------------------------------------------------------- */---------------------------------------------------------
--to-do
--return infomation to a client via json or composite type
AS $f$ AS $f$
DECLARE _t text; DECLARE _t text;
DECLARE _c text; DECLARE _c text;