Project

General

Profile

« Previous | Next » 

Revision 12255

schemas/vegbien.sql: schema_null param: renamed to schema_anchor to clarify what this is for

View differences:

trunk/schemas/vegbien.my.sql
366 366

  
367 367

  
368 368
--
369
-- Name: FUNCTION datasource_publish(datasource varchar(255), schema_null anyelement); Type: COMMENT; Schema: public; Owner: -
369
-- Name: FUNCTION datasource_publish(datasource varchar(255), schema_anchor anyelement); Type: COMMENT; Schema: public; Owner: -
370 370
--
371 371

  
372 372

  
......
380 380

  
381 381

  
382 382
--
383
-- Name: FUNCTION datasource_rename(old varchar(255), new varchar(255), schema_null anyelement); Type: COMMENT; Schema: public; Owner: -
383
-- Name: FUNCTION datasource_rename(old varchar(255), new varchar(255), schema_anchor anyelement); Type: COMMENT; Schema: public; Owner: -
384 384
--
385 385

  
386 386

  
......
394 394

  
395 395

  
396 396
--
397
-- Name: FUNCTION datasource_rm(datasource varchar(255), schema_null anyelement); Type: COMMENT; Schema: public; Owner: -
397
-- Name: FUNCTION datasource_rm(datasource varchar(255), schema_anchor anyelement); Type: COMMENT; Schema: public; Owner: -
398 398
--
399 399

  
400 400

  
......
408 408

  
409 409

  
410 410
--
411
-- Name: FUNCTION datasource_unpublish(datasource varchar(255), schema_null anyelement); Type: COMMENT; Schema: public; Owner: -
411
-- Name: FUNCTION datasource_unpublish(datasource varchar(255), schema_anchor anyelement); Type: COMMENT; Schema: public; Owner: -
412 412
--
413 413

  
414 414

  
......
638 638

  
639 639

  
640 640
--
641
-- Name: FUNCTION publish(schema_null anyelement); Type: COMMENT; Schema: public; Owner: -
641
-- Name: FUNCTION publish(schema_anchor anyelement); Type: COMMENT; Schema: public; Owner: -
642 642
--
643 643

  
644 644

  
......
652 652

  
653 653

  
654 654
--
655
-- Name: FUNCTION rm(schema_null anyelement); Type: COMMENT; Schema: public; Owner: -
655
-- Name: FUNCTION rm(schema_anchor anyelement); Type: COMMENT; Schema: public; Owner: -
656 656
--
657 657

  
658 658

  
trunk/schemas/vegbien.sql
343 343
-- Name: TYPE schema_anchor; Type: COMMENT; Schema: public; Owner: -
344 344
--
345 345

  
346
COMMENT ON TYPE schema_anchor IS 'used with schema_null params';
346
COMMENT ON TYPE schema_anchor IS 'used with schema_anchor params';
347 347

  
348 348

  
349 349
--
......
456 456
-- Name: TYPE schema_anchor; Type: COMMENT; Schema: public_validations; Owner: -
457 457
--
458 458

  
459
COMMENT ON TYPE schema_anchor IS 'used with schema_null params';
459
COMMENT ON TYPE schema_anchor IS 'used with schema_anchor params';
460 460

  
461 461

  
462 462
SET search_path = public, pg_catalog;
......
715 715
-- Name: datasource_publish(text, anyelement); Type: FUNCTION; Schema: public; Owner: -
716 716
--
717 717

  
718
CREATE FUNCTION datasource_publish(datasource text, schema_null anyelement DEFAULT NULL::schema_anchor) RETURNS void
718
CREATE FUNCTION datasource_publish(datasource text, schema_anchor anyelement DEFAULT NULL::schema_anchor) RETURNS void
719 719
    LANGUAGE plpgsql
720 720
    AS $$
721 721
DECLARE
722 722
	live_datasource text := rm_version_suffix(datasource);
723 723
BEGIN
724
	PERFORM set_config('search_path', util.schema_esc(schema_null), true);
724
	PERFORM set_config('search_path', util.schema_esc(schema_anchor), true);
725 725
	
726 726
	-- don't datasource_rm() the datasource to publish!
727 727
	IF live_datasource = datasource THEN RETURN; END IF;
728 728
	
729
	PERFORM datasource_rm(live_datasource, schema_null);
730
	PERFORM datasource_rename(datasource, live_datasource, schema_null);
729
	PERFORM datasource_rm(live_datasource, schema_anchor);
730
	PERFORM datasource_rename(datasource, live_datasource, schema_anchor);
731 731
END;
732 732
$$;
733 733

  
734 734

  
735 735
--
736
-- Name: FUNCTION datasource_publish(datasource text, schema_null anyelement); Type: COMMENT; Schema: public; Owner: -
736
-- Name: FUNCTION datasource_publish(datasource text, schema_anchor anyelement); Type: COMMENT; Schema: public; Owner: -
737 737
--
738 738

  
739
COMMENT ON FUNCTION datasource_publish(datasource text, schema_null anyelement) IS '
739
COMMENT ON FUNCTION datasource_publish(datasource text, schema_anchor anyelement) IS '
740 740
secure against renamings of the public schema.
741 741

  
742
schema_null: identifies which schema to use. should be left as the default value.
742
schema_anchor: identifies which schema to use. should be left as the default value.
743 743
';
744 744

  
745 745

  
......
747 747
-- Name: datasource_rename(text, text, anyelement); Type: FUNCTION; Schema: public; Owner: -
748 748
--
749 749

  
750
CREATE FUNCTION datasource_rename(old text, new text, schema_null anyelement DEFAULT NULL::schema_anchor) RETURNS void
750
CREATE FUNCTION datasource_rename(old text, new text, schema_anchor anyelement DEFAULT NULL::schema_anchor) RETURNS void
751 751
    LANGUAGE sql
752 752
    AS $_$
753 753
SELECT set_config('search_path', util.schema_esc($3), true);
......
756 756

  
757 757

  
758 758
--
759
-- Name: FUNCTION datasource_rename(old text, new text, schema_null anyelement); Type: COMMENT; Schema: public; Owner: -
759
-- Name: FUNCTION datasource_rename(old text, new text, schema_anchor anyelement); Type: COMMENT; Schema: public; Owner: -
760 760
--
761 761

  
762
COMMENT ON FUNCTION datasource_rename(old text, new text, schema_null anyelement) IS '
762
COMMENT ON FUNCTION datasource_rename(old text, new text, schema_anchor anyelement) IS '
763 763
secure against renamings of the public schema.
764 764

  
765
schema_null: identifies which schema to use. should be left as the default value.
765
schema_anchor: identifies which schema to use. should be left as the default value.
766 766
';
767 767

  
768 768

  
......
770 770
-- Name: datasource_rm(text, anyelement); Type: FUNCTION; Schema: public; Owner: -
771 771
--
772 772

  
773
CREATE FUNCTION datasource_rm(datasource text, schema_null anyelement DEFAULT NULL::schema_anchor) RETURNS void
773
CREATE FUNCTION datasource_rm(datasource text, schema_anchor anyelement DEFAULT NULL::schema_anchor) RETURNS void
774 774
    LANGUAGE sql
775 775
    AS $_$
776 776
SELECT set_config('search_path', util.schema_esc($2), true);
......
779 779

  
780 780

  
781 781
--
782
-- Name: FUNCTION datasource_rm(datasource text, schema_null anyelement); Type: COMMENT; Schema: public; Owner: -
782
-- Name: FUNCTION datasource_rm(datasource text, schema_anchor anyelement); Type: COMMENT; Schema: public; Owner: -
783 783
--
784 784

  
785
COMMENT ON FUNCTION datasource_rm(datasource text, schema_null anyelement) IS '
785
COMMENT ON FUNCTION datasource_rm(datasource text, schema_anchor anyelement) IS '
786 786
secure against renamings of the public schema.
787 787

  
788
schema_null: identifies which schema to use. should be left as the default value.
788
schema_anchor: identifies which schema to use. should be left as the default value.
789 789

  
790 790
runtime:
791 791
ACAD:  30 s  :   27738 ms/   45,503 rows = 0.61 ms/row
......
803 803
-- Name: datasource_unpublish(text, anyelement); Type: FUNCTION; Schema: public; Owner: -
804 804
--
805 805

  
806
CREATE FUNCTION datasource_unpublish(datasource text, schema_null anyelement DEFAULT NULL::schema_anchor) RETURNS void
806
CREATE FUNCTION datasource_unpublish(datasource text, schema_anchor anyelement DEFAULT NULL::schema_anchor) RETURNS void
807 807
    LANGUAGE sql
808 808
    AS $_$
809 809
SELECT set_config('search_path', util.schema_esc($3), true);
......
812 812

  
813 813

  
814 814
--
815
-- Name: FUNCTION datasource_unpublish(datasource text, schema_null anyelement); Type: COMMENT; Schema: public; Owner: -
815
-- Name: FUNCTION datasource_unpublish(datasource text, schema_anchor anyelement); Type: COMMENT; Schema: public; Owner: -
816 816
--
817 817

  
818
COMMENT ON FUNCTION datasource_unpublish(datasource text, schema_null anyelement) IS '
818
COMMENT ON FUNCTION datasource_unpublish(datasource text, schema_anchor anyelement) IS '
819 819
secure against renamings of the public schema.
820 820

  
821
schema_null: identifies which schema to use. should be left as the default value.
821
schema_anchor: identifies which schema to use. should be left as the default value.
822 822
';
823 823

  
824 824

  
......
1339 1339
-- Name: publish(anyelement); Type: FUNCTION; Schema: public; Owner: -
1340 1340
--
1341 1341

  
1342
CREATE FUNCTION publish(schema_null anyelement DEFAULT NULL::schema_anchor) RETURNS void
1342
CREATE FUNCTION publish(schema_anchor anyelement DEFAULT NULL::schema_anchor) RETURNS void
1343 1343
    LANGUAGE plpgsql
1344 1344
    AS $$
1345 1345
BEGIN
1346
	PERFORM set_config('search_path', util.schema_esc(schema_null), true);
1347
	PERFORM public_schema_publish(util.schema_esc(schema_null));
1346
	PERFORM set_config('search_path', util.schema_esc(schema_anchor), true);
1347
	PERFORM public_schema_publish(util.schema_esc(schema_anchor));
1348 1348
END;
1349 1349
$$;
1350 1350

  
1351 1351

  
1352 1352
--
1353
-- Name: FUNCTION publish(schema_null anyelement); Type: COMMENT; Schema: public; Owner: -
1353
-- Name: FUNCTION publish(schema_anchor anyelement); Type: COMMENT; Schema: public; Owner: -
1354 1354
--
1355 1355

  
1356
COMMENT ON FUNCTION publish(schema_null anyelement) IS '
1356
COMMENT ON FUNCTION publish(schema_anchor anyelement) IS '
1357 1357
publishes this schema.
1358 1358

  
1359 1359
usage: SELECT public_schema.publish()
......
1362 1362

  
1363 1363
secure against renamings of the public schema.
1364 1364

  
1365
schema_null: identifies which schema to use. should be left as the default value.
1365
schema_anchor: identifies which schema to use. should be left as the default value.
1366 1366
';
1367 1367

  
1368 1368

  
......
1370 1370
-- Name: rm(anyelement); Type: FUNCTION; Schema: public; Owner: -
1371 1371
--
1372 1372

  
1373
CREATE FUNCTION rm(schema_null anyelement DEFAULT NULL::schema_anchor) RETURNS void
1373
CREATE FUNCTION rm(schema_anchor anyelement DEFAULT NULL::schema_anchor) RETURNS void
1374 1374
    LANGUAGE plpgsql
1375 1375
    AS $$
1376 1376
BEGIN
1377
	PERFORM set_config('search_path', util.schema_esc(schema_null), true);
1378
	PERFORM util.schema_bundle_rm(util.schema_esc(schema_null));
1377
	PERFORM set_config('search_path', util.schema_esc(schema_anchor), true);
1378
	PERFORM util.schema_bundle_rm(util.schema_esc(schema_anchor));
1379 1379
END;
1380 1380
$$;
1381 1381

  
1382 1382

  
1383 1383
--
1384
-- Name: FUNCTION rm(schema_null anyelement); Type: COMMENT; Schema: public; Owner: -
1384
-- Name: FUNCTION rm(schema_anchor anyelement); Type: COMMENT; Schema: public; Owner: -
1385 1385
--
1386 1386

  
1387
COMMENT ON FUNCTION rm(schema_null anyelement) IS '
1387
COMMENT ON FUNCTION rm(schema_anchor anyelement) IS '
1388 1388
deletes this schema.
1389 1389

  
1390 1390
usage: SELECT public_schema.rm()
......
1393 1393

  
1394 1394
secure against renamings of the public schema.
1395 1395

  
1396
schema_null: identifies which schema to use. should be left as the default value.
1396
schema_anchor: identifies which schema to use. should be left as the default value.
1397 1397
';
1398 1398

  
1399 1399

  

Also available in: Unified diff