8000 GitHub - thoshiai/my_decoding: test for logical decoding
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

thoshiai/my_decoding

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

my_decoding
-----------

test for logical decode.

procedure:

cd {current_directory};
make;
sudo make install;

initdb --no-locale --encoding=UTF-8 -D {PGDATA};
pg_ctl -D {PG_DATA} start;
createdb test;

psql test -c "SELECT * FROM pg_create_logical_replication_slot('my_decode','my_decoding');";
psql test -c "CREATE TABLE test_tbl (id int, name text)";

psql test -c "
BEGIN;
INSERT INTO test_tbl VALUES(1,'one'),(2,'two'),(3,'three');
COMMIT;"

psql test -c "
BEGIN;
UPDATE test_tbl SET name = 'UPDATED' WHERE id < 3;
DELETE FROM test_tbl WHERE id >= 3;
INSERT INTO test_tbl VALUES(3,'new 3');
COMMIT;"

psql test -c "SELECT * FROM pg_logical_slot_peek_changes('my_decode', NULL,NULL);";
 or
psql test -c "SELECT * FROM pg_logical_slot_get_changes('my_decode', NULL,NULL);";

About

test for logical decoding

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0