Commit a804fdba authored by Keith Jolley's avatar Keith Jolley

Fix pg create_scheme_warehouse() for field names with capitals.

parent 5d46378c
......@@ -1080,7 +1080,7 @@ CREATE OR REPLACE FUNCTION initiate_scheme_warehouse(i_id int) RETURNS VOID AS $
|| 'profiles WHERE scheme_id=%s',scheme_table,pk,i_id);
FOR x IN SELECT * FROM profile_fields WHERE scheme_id=i_id AND scheme_field NOT IN
(SELECT field FROM scheme_fields WHERE scheme_id=i_id AND primary_key) LOOP
EXECUTE FORMAT('UPDATE %I SET %I=$1 WHERE %s=$2',
EXECUTE FORMAT('UPDATE %I SET %s=$1 WHERE %s=$2',
scheme_table,x.scheme_field,pk) USING x.value,x.profile_id;
END LOOP;
......
......@@ -100,7 +100,7 @@ CREATE OR REPLACE FUNCTION initiate_scheme_warehouse(i_id int) RETURNS VOID AS $
|| 'profiles WHERE scheme_id=%s',scheme_table,pk,i_id);
FOR x IN SELECT * FROM profile_fields WHERE scheme_id=i_id AND scheme_field NOT IN
(SELECT field FROM scheme_fields WHERE scheme_id=i_id AND primary_key) LOOP
EXECUTE FORMAT('UPDATE %I SET %I=$1 WHERE %s=$2',
EXECUTE FORMAT('UPDATE %I SET %s=$1 WHERE %s=$2',
scheme_table,x.scheme_field,pk) USING x.value,x.profile_id;
END LOOP;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment