File tree 2 files changed +0
-34
lines changed
2 files changed +0
-34
lines changed Original file line number Diff line number Diff line change @@ -843,22 +843,6 @@ SELECT * FROM wq_target;
843
843
1 | 499
844
844
(1 row)
845
845
846
- -- test preventing WHEN conditions from writing to the database
847
- create or replace function merge_when_and_write() returns boolean
848
- language plpgsql as
849
- $$
850
- BEGIN
851
- INSERT INTO target VALUES (100, 100);
852
- RETURN TRUE;
853
- END;
854
- $$;
855
- BEGIN;
856
- MERGE INTO wq_target t
857
- USING wq_source s ON t.tid = s.sid
858
- WHEN MATCHED AND (merge_when_and_write()) THEN
859
- UPDATE SET balance = t.balance + s.balance;
860
- ROLLBACK;
861
- drop function merge_when_and_write();
862
846
DROP TABLE wq_target, wq_source;
863
847
-- test triggers
864
848
create or replace function merge_trigfunc () returns trigger
Original file line number Diff line number Diff line change @@ -564,24 +564,6 @@ WHEN MATCHED AND t.tableoid >= 0 THEN
564
564
UPDATE SET balance = t .balance + s .balance ;
565
565
SELECT * FROM wq_target;
566
566
567
- -- test preventing WHEN conditions from writing to the database
568
- create or replace function merge_when_and_write () returns boolean
569
- language plpgsql as
570
- $$
571
- BEGIN
572
- INSERT INTO target VALUES (100 , 100 );
573
- RETURN TRUE;
574
- END;
575
- $$;
576
-
577
- BEGIN ;
578
- MERGE INTO wq_target t
579
- USING wq_source s ON t .tid = s .sid
580
- WHEN MATCHED AND (merge_when_and_write()) THEN
581
- UPDATE SET balance = t .balance + s .balance ;
582
- ROLLBACK ;
583
- drop function merge_when_and_write();
584
-
585
567
DROP TABLE wq_target, wq_source;
586
568
587
569
-- test triggers
You can’t perform that action at this time.
0 commit comments