Project

General

Profile

« Previous | Next » 

Revision 10856

schemas/vegbien.sql: added datasource_rename()

View differences:

schemas/vegbien.my.sql
366 366

  
367 367

  
368 368
--
369
-- Name: datasource_rename(varchar(255), varchar(255), anyelement); Type: FUNCTION; Schema: public; Owner: -
370
--
371

  
372

  
373

  
374

  
375
--
376
-- Name: FUNCTION datasource_rename(old varchar(255), new varchar(255), schema_null anyelement); Type: COMMENT; Schema: public; Owner: -
377
--
378

  
379

  
380

  
381

  
382
--
369 383
-- Name: datasource_rm(varchar(255), anyelement); Type: FUNCTION; Schema: public; Owner: -
370 384
--
371 385

  
schemas/vegbien.sql
720 720

  
721 721

  
722 722
--
723
-- Name: datasource_rename(text, text, anyelement); Type: FUNCTION; Schema: public; Owner: -
724
--
725

  
726
CREATE FUNCTION datasource_rename(old text, new text, schema_null anyelement DEFAULT NULL::source) RETURNS void
727
    LANGUAGE sql
728
    AS $_$
729
SELECT set_config('search_path', util.schema_ident($3), true);
730
UPDATE source SET shortname = $2 WHERE shortname = $1;
731
$_$;
732

  
733

  
734
--
735
-- Name: FUNCTION datasource_rename(old text, new text, schema_null anyelement); Type: COMMENT; Schema: public; Owner: -
736
--
737

  
738
COMMENT ON FUNCTION datasource_rename(old text, new text, schema_null anyelement) IS 'secure against renamings of the public schema.
739

  
740
schema_null: identifies which schema''s tables to use. the default value is usually fine.
741
';
742

  
743

  
744
--
723 745
-- Name: datasource_rm(text, anyelement); Type: FUNCTION; Schema: public; Owner: -
724 746
--
725 747

  

Also available in: Unified diff