Project

General

Profile

« Previous | Next » 

Revision 12238

schemas/util.sql: schema_ident(): renamed to schema_esc() for clarity

View differences:

trunk/schemas/util.sql
2141 2141

  
2142 2142

  
2143 2143
--
2144
-- Name: schema_ident(anyelement); Type: FUNCTION; Schema: util; Owner: -
2144
-- Name: schema_esc(anyelement); Type: FUNCTION; Schema: util; Owner: -
2145 2145
--
2146 2146

  
2147
CREATE FUNCTION schema_ident(type_null anyelement) RETURNS text
2147
CREATE FUNCTION schema_esc(type_null anyelement) RETURNS text
2148 2148
    LANGUAGE sql STABLE
2149 2149
    AS $_$
2150 2150
SELECT quote_ident(util.schema($1))
trunk/schemas/vegbien.sql
753 753
DECLARE
754 754
	live_datasource text := rm_version_suffix(datasource);
755 755
BEGIN
756
	PERFORM set_config('search_path', util.schema_ident(schema_null), true);
756
	PERFORM set_config('search_path', util.schema_esc(schema_null), true);
757 757
	
758 758
	-- don't datasource_rm() the datasource to publish!
759 759
	IF live_datasource = datasource THEN RETURN; END IF;
......
782 782
CREATE FUNCTION datasource_rename(old text, new text, schema_null anyelement DEFAULT NULL::source) RETURNS void
783 783
    LANGUAGE sql
784 784
    AS $_$
785
SELECT set_config('search_path', util.schema_ident($3), true);
785
SELECT set_config('search_path', util.schema_esc($3), true);
786 786
UPDATE source SET shortname = $2 WHERE shortname = $1;
787 787
$_$;
788 788

  
......
805 805
CREATE FUNCTION datasource_rm(datasource text, schema_null anyelement DEFAULT NULL::source) RETURNS void
806 806
    LANGUAGE sql
807 807
    AS $_$
808
SELECT set_config('search_path', util.schema_ident($2), true);
808
SELECT set_config('search_path', util.schema_esc($2), true);
809 809
DELETE FROM source WHERE shortname = $1;
810 810
$_$;
811 811

  
......
838 838
CREATE FUNCTION datasource_unpublish(datasource text, schema_null anyelement DEFAULT NULL::source) RETURNS void
839 839
    LANGUAGE sql
840 840
    AS $_$
841
SELECT set_config('search_path', util.schema_ident($3), true);
841
SELECT set_config('search_path', util.schema_esc($3), true);
842 842
SELECT datasource_rename($1, $1||'.new');
843 843
$_$;
844 844

  
......
1371 1371
    LANGUAGE plpgsql
1372 1372
    AS $$
1373 1373
BEGIN
1374
	PERFORM set_config('search_path', util.schema_ident(schema_null), true);
1375
	PERFORM public_schema_publish(util.schema_ident(schema_null));
1374
	PERFORM set_config('search_path', util.schema_esc(schema_null), true);
1375
	PERFORM public_schema_publish(util.schema_esc(schema_null));
1376 1376
END;
1377 1377
$$;
1378 1378

  
......
1402 1402
    LANGUAGE plpgsql
1403 1403
    AS $$
1404 1404
BEGIN
1405
	PERFORM set_config('search_path', util.schema_ident(schema_null), true);
1406
	PERFORM util.schema_bundle_rm(util.schema_ident(schema_null));
1405
	PERFORM set_config('search_path', util.schema_esc(schema_null), true);
1406
	PERFORM util.schema_bundle_rm(util.schema_esc(schema_null));
1407 1407
END;
1408 1408
$$;
1409 1409

  

Also available in: Unified diff