|
65 | 65 | $tsql_newnode->init_tsql('test_master', 'testdb'); |
66 | 66 | $newnode->stop; |
67 | 67 |
|
| 68 | +# Setup pg16 node |
| 69 | +my $node15 = |
| 70 | + PostgreSQL::Test::Cluster->new('node_15', |
| 71 | + install_path => $ENV{installdir15}); |
| 72 | + |
| 73 | +my $newbindir = $newnode->config_data('--bindir'); |
| 74 | +my $oldbindir = $oldnode->config_data('--bindir'); |
| 75 | +my $bindir15 = $node15->config_data('--bindir'); |
| 76 | + |
68 | 77 | # Dump global objects using pg_dumpall. Note that we |
69 | 78 | # need to use dump utilities from the new node here. |
70 | 79 | $oldnode->start; |
71 | 80 | my @dumpall_command = ( |
72 | | - 'pg_dumpall', '--database', 'testdb', '--username', 'test_master', |
| 81 | + $bindir15 . '/pg_dumpall', '--database', 'testdb', '--username', 'test_master', |
73 | 82 | '--port', $oldnode->port, '--roles-only', '--quote-all-identifiers', |
74 | 83 | '--verbose', '--no-role-passwords', '--file', $dump1_file); |
75 | | -$newnode->command_ok(\@dumpall_command, 'Dump global objects.'); |
| 84 | +$node15->command_ok(\@dumpall_command, 'Dump global objects.'); |
76 | 85 | # Dump Babelfish database using pg_dump. |
77 | 86 | my @dump_command = ( |
78 | | - 'pg_dump', '--username', 'test_master', '--quote-all-identifiers', |
| 87 | + $bindir15 . '/pg_dump', '--username', 'test_master', '--quote-all-identifiers', |
79 | 88 | '--port', $oldnode->port, '--verbose', '--dbname', 'testdb', |
80 | 89 | '--file', $dump2_file); |
81 | | -$newnode->command_ok(\@dump_command, 'Dump Babelfish database.'); |
| 90 | +$node15->command_ok(\@dump_command, 'Dump Babelfish database.'); |
82 | 91 | $oldnode->stop; |
83 | 92 |
|
84 | 93 | # Retore the dumped files on the new server. |
|
88 | 97 | # dump/restore is not yet supported. |
89 | 98 | $newnode->command_fails_like( |
90 | 99 | [ |
91 | | - 'psql', |
| 100 | + $newbindir . '/psql', |
92 | 101 | '-d', 'testdb', |
93 | 102 | '-U', 'test_master', |
94 | 103 | '-p', $newnode->port, |
|
101 | 110 | # Similarly, restore of dump file should also cause a failure. |
102 | 111 | $newnode->command_fails_like( |
103 | 112 | [ |
104 | | - 'psql', |
| 113 | + $newbindir . '/psql', |
105 | 114 | '-d', 'testdb', |
106 | 115 | '-U', 'test_master', |
107 | 116 | '-p', $newnode->port, |
|
117 | 126 |
|
118 | 127 | $oldnode->command_fails_like( |
119 | 128 | [ |
120 | | - 'psql', |
| 129 | + $oldbindir . '/psql', |
121 | 130 | '-d', 'testdb', |
122 | 131 | '-U', 'test_master', |
123 | 132 | '-p', $oldnode->port, |
|
129 | 138 |
|
130 | 139 | $oldnode->command_fails_like( |
131 | 140 | [ |
132 | | - 'psql', |
| 141 | + $oldbindir . '/psql', |
133 | 142 | '-d', 'testdb', |
134 | 143 | '-U', 'test_master', |
135 | 144 | '-p', $oldnode->port, |
|
162 | 171 | # Dump global objects using pg_dumpall. Note that we |
163 | 172 | # need to use dump utilities from the new node here. |
164 | 173 | @dumpall_command = ( |
165 | | - 'pg_dumpall', '--database', 'testdb', '--username', 'test_master', |
| 174 | + $newbindir . '/pg_dumpall', '--database', 'testdb', '--username', 'test_master', |
166 | 175 | '--port', $newnode2->port, '--roles-only', '--quote-all-identifiers', |
167 | 176 | '--verbose', '--no-role-passwords', '--file', $dump3_file); |
168 | 177 | $newnode2->command_ok(\@dumpall_command, 'Dump global objects.'); |
169 | 178 | # Dump Babelfish database using pg_dump. Let's dump with the custom format |
170 | 179 | # this time so that we cover pg_restore as well. |
171 | 180 | @dump_command = ( |
172 | | - 'pg_dump', '--username', 'test_master', '--quote-all-identifiers', |
| 181 | + $newbindir . '/pg_dump', '--username', 'test_master', '--quote-all-identifiers', |
173 | 182 | '--port', $newnode2->port, '--verbose', '--dbname', 'testdb', |
174 | 183 | '--format', 'custom', '--file', $dump4_file); |
175 | 184 | $newnode2->command_ok(\@dump_command, 'Dump Babelfish database.'); |
|
182 | 191 | # dump/restore is not yet supported. |
183 | 192 | $newnode->command_fails_like( |
184 | 193 | [ |
185 | | - 'psql', |
| 194 | + $newbindir . '/psql', |
186 | 195 | '-d', 'testdb', |
187 | 196 | '-U', 'test_master', |
188 | 197 | '-p', $newnode->port, |
|
195 | 204 | # Similarly, restore of dump file should also cause a failure. |
196 | 205 | $newnode->command_fails_like( |
197 | 206 | [ |
198 | | - 'pg_restore', |
| 207 | + $newbindir . '/pg_restore', |
199 | 208 | '-d', 'testdb', |
200 | 209 | '-U', 'test_master', |
201 | 210 | '-p', $newnode->port, |
|
213 | 222 |
|
214 | 223 | # Dump global objects using pg_dumpall. |
215 | 224 | @dumpall_command = ( |
216 | | - 'pg_dumpall', '--database', 'postgres', '--port', $newnode->port, |
| 225 | + $newbindir . '/pg_dumpall', '--database', 'postgres', '--port', $newnode->port, |
217 | 226 | '--roles-only', '--quote-all-identifiers', '--verbose', |
218 | 227 | '--no-role-passwords', '--file', $dump1_file); |
219 | 228 | $newnode->command_ok(\@dumpall_command, 'Dump global objects.'); |
220 | 229 | # Dump Babelfish database using pg_dump. |
221 | 230 | @dump_command = ( |
222 | | - 'pg_dump', '--quote-all-identifiers', '--port', $newnode->port, |
| 231 | + $newbindir . '/pg_dump', '--quote-all-identifiers', '--port', $newnode->port, |
223 | 232 | '--verbose', '--dbname', 'postgres', |
224 | 233 | '--file', $dump2_file); |
225 | 234 | $newnode->command_ok(\@dump_command, 'Dump non-Babelfish (postgres db) database.'); |
|
0 commit comments