Project

General

Profile

« Previous | Next » 

Revision 12273

bugfix: schemas/vegbien.sql: setting search_path locally: need to use `SET LOCAL search_path TO` instead of `PERFORM set_config(search_path, ..., is_local := true)` because the meaning of is_local refers to the entire transaction, not just the current function (as for LOCAL)

View differences:

trunk/schemas/vegbien.sql
724 724
DECLARE
725 725
	live_datasource text := rm_version_suffix(datasource);
726 726
BEGIN
727
	PERFORM set_config('search_path', util.schema_esc(schema_anchor), true);
727
	EXECUTE util.mk_use_own_schema(schema_anchor);
728 728
	
729 729
	-- don't datasource_rm() the datasource to publish!
730 730
	IF live_datasource = datasource THEN RETURN; END IF;
......
757 757
changes of search_path (schema elements are bound at inline time rather than
758 758
runtime) */
759 759
BEGIN
760
	PERFORM set_config('search_path', util.schema_esc(schema_anchor), true);
760
	EXECUTE util.mk_use_own_schema(schema_anchor);
761 761
	UPDATE source SET shortname = new WHERE shortname = old;
762 762
END;
763 763
$$;
......
785 785
changes of search_path (schema elements are bound at inline time rather than
786 786
runtime) */
787 787
BEGIN
788
	PERFORM set_config('search_path', util.schema_esc(schema_anchor), true);
788
	EXECUTE util.mk_use_own_schema(schema_anchor);
789 789
	DELETE FROM source WHERE shortname = datasource;
790 790
END;
791 791
$$;
......
823 823
changes of search_path (schema elements are bound at inline time rather than
824 824
runtime) */
825 825
BEGIN
826
	PERFORM set_config('search_path', util.schema_esc(schema_anchor), true);
826
	EXECUTE util.mk_use_own_schema(schema_anchor);
827 827
	PERFORM datasource_rename(datasource, datasource||'.new');
828 828
END;
829 829
$$;
......
1364 1364
changes of search_path (schema elements are bound at inline time rather than
1365 1365
runtime) */
1366 1366
BEGIN
1367
	PERFORM set_config('search_path', util.schema_esc(schema_anchor), true);
1367
	EXECUTE util.mk_use_own_schema(schema_anchor);
1368 1368
	PERFORM public_schema_publish(util.schema_esc(schema_anchor));
1369 1369
END;
1370 1370
$$;
......
1398 1398
changes of search_path (schema elements are bound at inline time rather than
1399 1399
runtime) */
1400 1400
BEGIN
1401
	PERFORM set_config('search_path', util.schema_esc(schema_anchor), true);
1401
	EXECUTE util.mk_use_own_schema(schema_anchor);
1402 1402
	PERFORM util.schema_bundle_rm(util.schema_esc(schema_anchor));
1403 1403
END;
1404 1404
$$;
......
1446 1446
	source_id integer;
1447 1447
	shortname_ text = shortname;
1448 1448
BEGIN
1449
	PERFORM set_config('search_path', util.schema_esc(schema_anchor), true);
1449
	EXECUTE util.mk_use_own_schema(schema_anchor);
1450 1450
	
1451 1451
	SELECT source_id INTO source_id
1452 1452
	FROM source WHERE shortname = shortname_ LIMIT 1
......
1974 1974
BEGIN
1975 1975
	/* datasource_schema must be 1st in the search_path so that queries can use
1976 1976
	it in current_schema */
1977
	PERFORM set_config('search_path', util.mk_search_path(datasource_schema),
1978
		true);
1977
	EXECUTE util.mk_set_search_path(datasource_schema, NULL);
1979 1978
	
1980 1979
	PERFORM util.rematerialize_view(out_table, out_view);
1981 1980
	
......
2009 2008
changes of search_path (schema elements are bound at inline time rather than
2010 2009
runtime) */
2011 2010
BEGIN
2012
	PERFORM set_config('search_path', util.schema_esc(schema_anchor), true);
2011
	EXECUTE util.mk_use_own_schema(schema_anchor);
2013 2012
	
2014 2013
	RETURN rematerialize_out_view(datasource_schema := util.schema(in_view),
2015 2014
		out_view := util.qual_name(util.schema(schema_anchor),

Also available in: Unified diff