Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PGXS "make installcheck" support #28

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
MODULE_big = decoderbufs
EXTENSION = decoderbufs
REGRESS = decoderbufs

PROTOBUF_C_CFLAGS = $(shell pkg-config --cflags 'libprotobuf-c >= 1.0.0')
PROTOBUF_C_LDFLAGS = $(shell pkg-config --libs 'libprotobuf-c >= 1.0.0')
Expand Down
27 changes: 27 additions & 0 deletions expected/decoderbufs.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
select slot_name from pg_create_logical_replication_slot('decoderbufs_demo', 'decoderbufs');
INFO: Exiting startup callback
slot_name
------------------
decoderbufs_demo
(1 row)

create table foo (id int primary key, data text);
insert into foo values (1, 'Important stuff');
select regexp_replace(data, '(txid|commit_time)\[\d+\]', '\1[***]', 'g') as data
from pg_logical_slot_peek_changes('decoderbufs_demo', NULL, NULL, 'debug-mode', '1');
NOTICE: Decoderbufs DEBUG MODE is ON.
INFO: Exiting startup callback
data
------------------------------------------------------------
txid[***], commit_time[***], op[3]
txid[***], commit_time[***], op[4]
txid[***], commit_time[***], op[3]
txid[***], commit_time[***], table[public.foo], op[0] +
NEW TUPLE: +
column_name[id], column_type[23], datum[1] +
column_name[data], column_type[25], datum[Important stuff]+
+

txid[***], commit_time[***], op[4]
(5 rows)

7 changes: 7 additions & 0 deletions sql/decoderbufs.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
select slot_name from pg_create_logical_replication_slot('decoderbufs_demo', 'decoderbufs');

create table foo (id int primary key, data text);
insert into foo values (1, 'Important stuff');

select regexp_replace(data, '(txid|commit_time)\[\d+\]', '\1[***]', 'g') as data
from pg_logical_slot_peek_changes('decoderbufs_demo', NULL, NULL, 'debug-mode', '1');