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.2 -r1.3 --- openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.9.1d19-5.9.1d20.sql 7 Aug 2017 23:47:56 -0000 1.2 +++ openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.9.1d19-5.9.1d20.sql 5 Oct 2017 11:18:24 -0000 1.3 @@ -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;