[open-ils-commits] r15400 - trunk/Open-ILS/src/sql/Pg (dbs)
svn at svn.open-ils.org
svn at svn.open-ils.org
Sun Jan 31 20:49:52 EST 2010
Author: dbs
Date: 2010-01-31 20:49:51 -0500 (Sun, 31 Jan 2010)
New Revision: 15400
Modified:
trunk/Open-ILS/src/sql/Pg/030.schema.metabib.sql
Log:
C-style comment was terminated prematurely by XPath expression in old biblio.flatten_marc()
SQL-style comments will avoid that problem and let us keep the old function around
for awhile for easy comparison with the new version.
Modified: trunk/Open-ILS/src/sql/Pg/030.schema.metabib.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/030.schema.metabib.sql 2010-01-29 20:36:26 UTC (rev 15399)
+++ trunk/Open-ILS/src/sql/Pg/030.schema.metabib.sql 2010-02-01 01:49:51 UTC (rev 15400)
@@ -310,33 +310,32 @@
END;
$func$ LANGUAGE PLPGSQL;
-/*
-CREATE OR REPLACE FUNCTION biblio.flatten_marc ( TEXT, BIGINT ) RETURNS SETOF metabib.full_rec AS $func$
- SELECT NULL::bigint AS id, NULL::bigint, 'LDR'::char(3), NULL::TEXT, NULL::TEXT, NULL::TEXT, oils_xpath_string( '//*[local-name()="leader"]', $1 ), NULL::tsvector AS index_vector
- UNION
- SELECT NULL::bigint AS id, NULL::bigint, x.tag::char(3), NULL::TEXT, NULL::TEXT, NULL::TEXT, x.value, NULL::tsvector AS index_vector
- FROM oils_xpath_table(
- 'id',
- 'marc',
- 'biblio.record_entry',
- '//*[local-name()="controlfield"]/@tag|//*[local-name()="controlfield"]',
- 'id=' || $2::TEXT
- )x(record int, tag text, value text)
- UNION
- SELECT NULL::bigint AS id, NULL::bigint, x.tag::char(3), x.ind1, x.ind2, x.subfield, x.value, NULL::tsvector AS index_vector
- FROM oils_xpath_table(
- 'id',
- 'marc',
- 'biblio.record_entry',
- '//*[local-name()="datafield"]/@tag|' ||
- '//*[local-name()="datafield"]/@ind1|' ||
- '//*[local-name()="datafield"]/@ind2|' ||
- '//*[local-name()="datafield"]/*/@code|' ||
- '//*[local-name()="datafield"]/*[@code]',
- 'id=' || $2::TEXT
- )x(record int, tag text, ind1 text, ind2 text, subfield text, value text);
-$func$ LANGUAGE SQL;
-*/
+/* Old form of biblio.flatten_marc() relied on contrib/xml2 functions that got all crashy in PostgreSQL 8.4 */
+-- CREATE OR REPLACE FUNCTION biblio.flatten_marc ( TEXT, BIGINT ) RETURNS SETOF metabib.full_rec AS $func$
+-- SELECT NULL::bigint AS id, NULL::bigint, 'LDR'::char(3), NULL::TEXT, NULL::TEXT, NULL::TEXT, oils_xpath_string( '//*[local-name()="leader"]', $1 ), NULL::tsvector AS index_vector
+-- UNION
+-- SELECT NULL::bigint AS id, NULL::bigint, x.tag::char(3), NULL::TEXT, NULL::TEXT, NULL::TEXT, x.value, NULL::tsvector AS index_vector
+-- FROM oils_xpath_table(
+-- 'id',
+-- 'marc',
+-- 'biblio.record_entry',
+-- '//*[local-name()="controlfield"]/@tag|//*[local-name()="controlfield"]',
+-- 'id=' || $2::TEXT
+-- )x(record int, tag text, value text)
+-- UNION
+-- SELECT NULL::bigint AS id, NULL::bigint, x.tag::char(3), x.ind1, x.ind2, x.subfield, x.value, NULL::tsvector AS index_vector
+-- FROM oils_xpath_table(
+-- 'id',
+-- 'marc',
+-- 'biblio.record_entry',
+-- '//*[local-name()="datafield"]/@tag|' ||
+-- '//*[local-name()="datafield"]/@ind1|' ||
+-- '//*[local-name()="datafield"]/@ind2|' ||
+-- '//*[local-name()="datafield"]/*/@code|' ||
+-- '//*[local-name()="datafield"]/*[@code]',
+-- 'id=' || $2::TEXT
+-- )x(record int, tag text, ind1 text, ind2 text, subfield text, value text);
+-- $func$ LANGUAGE SQL;
CREATE OR REPLACE FUNCTION biblio.flatten_marc ( TEXT ) RETURNS SETOF metabib.full_rec AS $func$
More information about the open-ils-commits
mailing list