[open-ils-commits] r10052 - in trunk: Evergreen/src/extras/import
Open-ILS/src/sql/Pg
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Jul 15 00:46:18 EDT 2008
Author: dbs
Date: 2008-07-15 00:46:15 -0400 (Tue, 15 Jul 2008)
New Revision: 10052
Modified:
trunk/Evergreen/src/extras/import/quick_metarecord_map.sql
trunk/Open-ILS/src/sql/Pg/006.schema.permissions.sql
trunk/Open-ILS/src/sql/Pg/020.schema.functions.sql
Log:
More preparation for PostgreSQL 8.3 support:
* quick_metarecord_map.sql - 8.3 no longer seems to support altering
the table within a single transaction, so we break this into two
transactions
* 006.schema.permissions.sql and 020.schema.functions.sql - add explicit
type casting where necessary
Modified: trunk/Evergreen/src/extras/import/quick_metarecord_map.sql
===================================================================
--- trunk/Evergreen/src/extras/import/quick_metarecord_map.sql 2008-07-15 04:34:00 UTC (rev 10051)
+++ trunk/Evergreen/src/extras/import/quick_metarecord_map.sql 2008-07-15 04:46:15 UTC (rev 10052)
@@ -18,6 +18,10 @@
FROM biblio.record_entry b
JOIN metabib.metarecord m ON (m.fingerprint = b.fingerprint);
+COMMIT;
+
+BEGIN;
+
ALTER TABLE metabib.metarecord_source_map ADD CONSTRAINT metabib_metarecord_source_map_metarecord_fkey FOREIGN KEY (metarecord) REFERENCES metabib.metarecord (id) DEFERRABLE INITIALLY DEFERRED;
COMMIT;
Modified: trunk/Open-ILS/src/sql/Pg/006.schema.permissions.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/006.schema.permissions.sql 2008-07-15 04:34:00 UTC (rev 10051)
+++ trunk/Open-ILS/src/sql/Pg/006.schema.permissions.sql 2008-07-15 04:46:15 UTC (rev 10052)
@@ -78,9 +78,9 @@
CREATE OR REPLACE FUNCTION permission.grp_ancestors ( INT ) RETURNS SETOF permission.grp_tree AS $$
SELECT a.*
- FROM connectby('permission.grp_tree','parent','id','name',$1,'100','.')
+ FROM connectby('permission.grp_tree'::text,'parent'::text,'id'::text,'name'::text,$1::text,100,'.'::text)
AS t(keyid text, parent_keyid text, level int, branch text,pos int)
- JOIN permission.grp_tree a ON a.id = t.keyid
+ JOIN permission.grp_tree a ON a.id::text = t.keyid::text
ORDER BY
CASE WHEN a.parent IS NULL
THEN 0
Modified: trunk/Open-ILS/src/sql/Pg/020.schema.functions.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/020.schema.functions.sql 2008-07-15 04:34:00 UTC (rev 10051)
+++ trunk/Open-ILS/src/sql/Pg/020.schema.functions.sql 2008-07-15 04:46:15 UTC (rev 10052)
@@ -134,30 +134,30 @@
CREATE OR REPLACE FUNCTION actor.org_unit_descendants ( INT ) RETURNS SETOF actor.org_unit AS $$
SELECT a.*
- FROM connectby('actor.org_unit','id','parent_ou','name',$1,'100','.')
+ FROM connectby('actor.org_unit'::text,'id'::text,'parent_ou'::text,'name'::text,$1::text,100,'.'::text)
AS t(keyid text, parent_keyid text, level int, branch text,pos int)
- JOIN actor.org_unit a ON a.id = t.keyid
+ JOIN actor.org_unit a ON a.id::text = t.keyid::text
ORDER BY CASE WHEN a.parent_ou IS NULL THEN 0 ELSE 1 END, a.name;
$$ LANGUAGE SQL STABLE;
CREATE OR REPLACE FUNCTION actor.org_unit_ancestors ( INT ) RETURNS SETOF actor.org_unit AS $$
SELECT a.*
- FROM connectby('actor.org_unit','parent_ou','id','name',$1,'100','.')
+ FROM connectby('actor.org_unit'::text,'parent_ou'::text,'id'::text,'name'::text,$1::text,100,'.'::text)
AS t(keyid text, parent_keyid text, level int, branch text,pos int)
- JOIN actor.org_unit a ON a.id = t.keyid
+ JOIN actor.org_unit a ON a.id::text = t.keyid::text
ORDER BY CASE WHEN a.parent_ou IS NULL THEN 0 ELSE 1 END, a.name;
$$ LANGUAGE SQL STABLE;
CREATE OR REPLACE FUNCTION actor.org_unit_descendants ( INT,INT ) RETURNS SETOF actor.org_unit AS $$
SELECT a.*
- FROM connectby('actor.org_unit','id','parent_ou','name',
+ FROM connectby('actor.org_unit'::text,'id'::text,'parent_ou'::text,'name'::text,
(SELECT x.id
FROM actor.org_unit_ancestors($1) x
JOIN actor.org_unit_type y ON x.ou_type = y.id
- WHERE y.depth = $2)
- ,'100','.')
+ WHERE y.depth = $2)::text
+ ,100,'.'::text)
AS t(keyid text, parent_keyid text, level int, branch text,pos int)
- JOIN actor.org_unit a ON a.id = t.keyid
+ JOIN actor.org_unit a ON a.id::text = t.keyid::text
ORDER BY CASE WHEN a.parent_ou IS NULL THEN 0 ELSE 1 END, a.name;
$$ LANGUAGE SQL STABLE;
More information about the open-ils-commits
mailing list