install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0267'); -- miker
+INSERT INTO config.upgrade_log (version) VALUES ('0268'); -- miker
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
$func$ LANGUAGE 'sql' STRICT IMMUTABLE;
CREATE OR REPLACE FUNCTION public.first_word ( TEXT ) RETURNS TEXT AS $$
- SELECT SUBSTRING( $1 FROM $_$^\S+$_$);
+ SELECT COALESCE(SUBSTRING( $1 FROM $_$^\S+$_$), '');
$$ LANGUAGE SQL STRICT IMMUTABLE;
CREATE OR REPLACE FUNCTION public.naco_normalize_keep_comma( TEXT ) RETURNS TEXT AS $func$
--- /dev/null
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0268'); -- miker
+
+CREATE OR REPLACE FUNCTION public.first_word ( TEXT ) RETURNS TEXT AS $$
+ SELECT COALESCE(SUBSTRING( $1 FROM $_$^\S+$_$), '');
+$$ LANGUAGE SQL STRICT IMMUTABLE;
+
+DELETE FROM config.metabib_field_index_norm_map WHERE norm IN (1,2) and field > 16;
+
+COMMIT;
+