Skip to content

Conversation

@NJrslv
Copy link
Contributor

@NJrslv NJrslv commented Jan 19, 2026

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

	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.")));
	}

The GetRestoreCommandHint() fails because libpq defaults to username as database and Greenplum blocks direct primary segment connections. Add explicit dbname=postgres and gp_session_role=utility to connection string.
@reshke reshke merged commit 620e095 into OPENGPDB_STABLE Jan 19, 2026
42 of 43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants