contrib/postgres_fdw/connection.c
static void
check_conn_params(const char **keywords, const char **values)
{
	int			i;

	/* no check required if superuser */
	if (superuser())
		return;

	/* ok if params contain a non-empty password */
	for (i = 0; keywords[i] != NULL; i++)
	{
		if (strcmp(keywords[i], "password") == 0 && values[i][0] != '\0')
			return;
	}

	ereport(ERROR,
			(errcode(ERRCODE_S_R_E_PROHIBITED_SQL_STATEMENT_ATTEMPTED),
			 errmsg("password is required"),
			 errdetail("Non-superusers must provide a password in the user mapping.")));
}
/*
 * For non-superusers, insist that the connstr specify a password.  This
 * prevents a password from being picked up from .pgpass, a service file,
 * the environment, etc.  We don't want the postgres user's passwords
 * to be accessible to non-superusers.  (See also dblink_connstr_check in
 * contrib/dblink.)
 */
For non-superusers, insist that the connstr specify a password.  This
prevents a password from being picked up from .pgpass, a service file,
the environment, etc.  We don't want the postgres user's passwords
to be accessible to non-superusers.  (See also dblink_connstr_check in
contrib/dblink.)
For non - superusers insist that the connstr specify a password . This prevents a password from being picked up from . pgpass a service file the environment etc . We don ' t want the postgres user ' s passwords to be accessible to non - superusers . ( See also dblink_connstr_check in contrib / dblink . )
static void
check_conn_params(const char **keywords, const char **values)
{
	int			i;
	if (superuser())
		return;
	for (i = 0; keywords[i] != NULL; i++)
	{
		if (strcmp(keywords[i], "password") == 0 && values[i][0] != '\0')
			return;
	}
	ereport(ERROR,
			(errcode(ERRCODE_S_R_E_PROHIBITED_SQL_STATEMENT_ATTEMPTED),
			 errmsg("password is required"),
			 errdetail("Non-superusers must provide a password in the user mapping.")));
}
static void check_conn_params ( const char * * keywords , const char * * values ) { int i ; if ( superuser ( ) ) return ; for ( i = 0 ; keywords [ i ] != NULL ; i ++ ) { if ( strcmp ( keywords [ i ] , " " ) == 0 && values [ i ] [ 0 ] != ' \0 ' ) return ; } ereport ( ERROR , ( errcode ( ERRCODE_S_R_E_PROHIBITED_SQL_STATEMENT_ATTEMPTED ) , errmsg ( " " ) , errdetail ( " " ) ) ) ; }
For non-superusers, insist that the connstr specify a password.
For non - superusers insist that the connstr specify a password .
/* no check required if superuser */ /* ok if params contain a non-empty password */