Commit 5b73d8f
committed
Fix pg_basebackup connection (#346)
The GetRestoreCommandHint() fails because libpq defaults to username for database name (which may not exist) and Greenplum blocks direct primary segment connections (this is done in [1]). Add explicit dbname=postgres and gp_session_role=utility to connection string.
[1] postinit.c
```c
else if ((Gp_session_role == GP_ROLE_DISPATCH) && !IS_QUERY_DISPATCHER())
{
ereport(FATAL,
(errcode(ERRCODE_CANNOT_CONNECT_NOW),
errmsg("connections to primary segments are not allowed"),
errdetail("This database instance is running as a primary segment in a Greenplum cluster and does not permit direct connections."),
errhint("To force a connection anyway (dangerous!), use utility mode.")));
}
```1 parent de8beb9 commit 5b73d8f
File tree
2 files changed
+14
-4
lines changed- src
- bin/pg_basebackup
- test/isolation2
2 files changed
+14
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1588 | 1588 | | |
1589 | 1589 | | |
1590 | 1590 | | |
| 1591 | + | |
1591 | 1592 | | |
1592 | | - | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
1593 | 1603 | | |
1594 | 1604 | | |
1595 | 1605 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
175 | | - | |
| 175 | + | |
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
257 | | - | |
258 | | - | |
| 257 | + | |
| 258 | + | |
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
| |||
0 commit comments