Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
3e353a7b
Commit
3e353a7b
authored
Jan 04, 2017
by
Simon Riggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new TAP tests for pg_recvlogical
Craig Ringer, reviewed by Euler Taveira and Naoki Okano
parent
7c030783
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
0 deletions
+48
-0
src/bin/pg_basebackup/Makefile
src/bin/pg_basebackup/Makefile
+2
-0
src/bin/pg_basebackup/t/030_pg_recvlogical.pl
src/bin/pg_basebackup/t/030_pg_recvlogical.pl
+46
-0
No files found.
src/bin/pg_basebackup/Makefile
View file @
3e353a7b
...
@@ -12,6 +12,8 @@
...
@@ -12,6 +12,8 @@
PGFILEDESC
=
"pg_basebackup/pg_receivexlog/pg_recvlogical - streaming WAL and backup receivers"
PGFILEDESC
=
"pg_basebackup/pg_receivexlog/pg_recvlogical - streaming WAL and backup receivers"
PGAPPICON
=
win32
PGAPPICON
=
win32
EXTRA_INSTALL
=
contrib/test_decoding
subdir
=
src/bin/pg_basebackup
subdir
=
src/bin/pg_basebackup
top_builddir
=
../../..
top_builddir
=
../../..
include
$(top_builddir)/src/Makefile.global
include
$(top_builddir)/src/Makefile.global
...
...
src/bin/pg_basebackup/t/030_pg_recvlogical.pl
0 → 100644
View file @
3e353a7b
use
strict
;
use
warnings
;
use
TestLib
;
use
PostgresNode
;
use
Test::
More
tests
=>
15
;
program_help_ok
('
pg_recvlogical
');
program_version_ok
('
pg_recvlogical
');
program_options_handling_ok
('
pg_recvlogical
');
my
$node
=
get_new_node
('
main
');
# Initialize node without replication settings
$node
->
init
(
allows_streaming
=>
1
,
has_archiving
=>
1
);
$node
->
append_conf
('
postgresql.conf
',
q{
wal_level = 'logical'
max_replication_slots = 4
max_wal_senders = 4
log_min_messages = 'debug1'
log_error_verbosity = verbose
}
);
$node
->
dump_info
;
$node
->
start
;
$node
->
command_fails
(['
pg_recvlogical
'],
'
pg_recvlogical needs a slot name
');
$node
->
command_fails
(['
pg_recvlogical
',
'
-S
',
'
test
'],
'
pg_recvlogical needs a database
');
$node
->
command_fails
(['
pg_recvlogical
',
'
-S
',
'
test
',
'
-d
',
'
postgres
'],
'
pg_recvlogical needs an action
');
$node
->
command_fails
(['
pg_recvlogical
',
'
-S
',
'
test
',
'
-d
',
$node
->
connstr
('
postgres
'),
'
--start
'],
'
no destionation file
');
$node
->
command_ok
(['
pg_recvlogical
',
'
-S
',
'
test
',
'
-d
',
$node
->
connstr
('
postgres
'),
'
--create-slot
'],
'
slot created
');
my
$slot
=
$node
->
slot
('
test
');
isnt
(
$slot
->
{'
restart_lsn
'},
'',
'
restart lsn is defined for new slot
');
$node
->
psql
('
postgres
',
'
CREATE TABLE test_table(x integer)
');
$node
->
psql
('
postgres
',
'
INSERT INTO test_table(x) SELECT y FROM generate_series(1, 10) a(y);
');
my
$nextlsn
=
$node
->
safe_psql
('
postgres
',
'
SELECT pg_current_xlog_insert_location()
');
chomp
(
$nextlsn
);
$node
->
command_ok
(['
pg_recvlogical
',
'
-S
',
'
test
',
'
-d
',
$node
->
connstr
('
postgres
'),
'
--start
',
'
--endpos
',
"
$nextlsn
",
'
--no-loop
',
'
-f
',
'
-
'],
'
replayed a transaction
');
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment