mirror of
https://github.com/postgres/postgres.git
synced 2025-06-14 18:42:34 +03:00
@ -93,22 +93,6 @@ COMMIT;
|
||||
/* display results */
|
||||
SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');
|
||||
|
||||
-- MERGE support
|
||||
BEGIN;
|
||||
MERGE INTO replication_example t
|
||||
USING (SELECT i as id, i as data, i as num FROM generate_series(-20, 5) i) s
|
||||
ON t.id = s.id
|
||||
WHEN MATCHED AND t.id < 0 THEN
|
||||
UPDATE SET somenum = somenum + 1
|
||||
WHEN MATCHED AND t.id >= 0 THEN
|
||||
DELETE
|
||||
WHEN NOT MATCHED THEN
|
||||
INSERT VALUES (s.*);
|
||||
COMMIT;
|
||||
|
||||
/* display results */
|
||||
SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');
|
||||
|
||||
CREATE TABLE tr_unique(id2 serial unique NOT NULL, data int);
|
||||
INSERT INTO tr_unique(data) VALUES(10);
|
||||
ALTER TABLE tr_unique RENAME TO tr_pkey;
|
||||
|
Reference in New Issue
Block a user