Index: openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.9.1d19-5.9.1d20.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.9.1d19-5.9.1d20.sql,v diff -u -r1.1.2.1 -r1.1.2.2 --- openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.9.1d19-5.9.1d20.sql 21 Dec 2016 00:14:56 -0000 1.1.2.1 +++ openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.9.1d19-5.9.1d20.sql 5 Oct 2017 10:44:33 -0000 1.1.2.2 @@ -7,14 +7,12 @@ -- -- procedure util__get_primary_keys/1 -- -CREATE OR REPLACE FUNCTION util__get_primary_keys( - p_table text -) RETURNS SETOF pg_attribute.attname%TYPE AS $$ +CREATE OR REPLACE FUNCTION util__get_primary_keys(text) RETURNS SETOF pg_attribute.attname%TYPE AS $$ SELECT a.attname FROM pg_index i JOIN pg_attribute a ON a.attrelid = i.indrelid AND a.attnum = ANY(i.indkey) - WHERE i.indrelid = p_table::regclass + WHERE i.indrelid = $1::regclass AND i.indisprimary; $$ LANGUAGE sql;