Index: openacs-4/packages/acs-kernel/sql/postgresql/utilities-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/utilities-create.sql,v diff -u -N -r1.11 -r1.12 --- openacs-4/packages/acs-kernel/sql/postgresql/utilities-create.sql 5 Oct 2017 09:35:57 -0000 1.11 +++ openacs-4/packages/acs-kernel/sql/postgresql/utilities-create.sql 28 Jan 2019 21:44:12 -0000 1.12 @@ -94,8 +94,8 @@ BEGIN return exists ( select 1 from information_schema.columns c - where c.table_name = t_name - and c.column_name = c_name); + where c.table_name = lower(t_name) + and c.column_name = lower(c_name)); END; $$ LANGUAGE plpgsql; @@ -164,10 +164,10 @@ and ccu.table_catalog = kcu.table_catalog and ccu.table_schema = kcu.table_schema and tc.constraint_type = 'FOREIGN KEY' - and tc.table_name = p_table - and kcu.column_name = p_column - and ccu.table_name = p_reftable - and ccu.column_name = p_refcolumn); + and tc.table_name = lower(p_table) + and kcu.column_name = lower(p_column) + and ccu.table_name = lower(p_reftable) + and ccu.column_name = lower(p_refcolumn)); END; $$ LANGUAGE plpgsql; @@ -194,8 +194,8 @@ and tc.table_catalog = kcu.table_catalog and tc.table_schema = kcu.table_schema and tc.constraint_type = 'UNIQUE' - and tc.table_name = p_table - and kcu.column_name = p_column + and tc.table_name = lower(p_table) + and kcu.column_name = lower(p_column) and (not p_single_p or ( -- this to ensure the constraint involves only one -- column @@ -229,8 +229,8 @@ and tc.table_catalog = kcu.table_catalog and tc.table_schema = kcu.table_schema and tc.constraint_type = 'PRIMARY KEY' - and tc.table_name = p_table - and kcu.column_name = p_column + and tc.table_name = lower(p_table) + and kcu.column_name = lower(p_column) and (not p_single_p or ( -- this to ensure the constraint involves only one -- column @@ -258,8 +258,8 @@ coalesce(( select is_nullable = 'NO' from information_schema.columns - where table_name = p_table - and column_name = p_column), false)); + where table_name = lower(p_table) + and column_name = lower(p_column)), false)); END; $$ LANGUAGE plpgsql; @@ -278,8 +278,8 @@ return ( select column_default from information_schema.columns - where table_name = p_table - and column_name = p_column); + where table_name = lower(p_table) + and column_name = lower(p_column)); END; $$ LANGUAGE plpgsql;