@@ -333,6 +333,23 @@ main(int argc, char *argv[])
333333if (!is_absolute_path (backup_path ))
334334elog (ERROR ,"-B, --backup-path must be an absolute path" );
335335
336+ /*
337+ * We read options from command line, now we need to read them from
338+ * configuration file since we got backup path and instance name.
339+ * For some commands an instance option isn't required, see above.
340+ */
341+ if (instance_name )
342+ {
343+ char path [MAXPGPATH ];
344+
345+ /* Read environment variables */
346+ config_get_opt_env (instance_options );
347+
348+ /* Read options from configuration file */
349+ join_path_components (path ,backup_instance_path ,BACKUP_CATALOG_CONF_FILE );
350+ config_read_opt (path ,instance_options ,ERROR , true);
351+ }
352+
336353if (IsSshProtocol ()
337354&& (backup_subcmd == BACKUP_CMD || backup_subcmd == ADD_INSTANCE_CMD || backup_subcmd == RESTORE_CMD ||
338355backup_subcmd == ARCHIVE_PUSH_CMD || backup_subcmd == ARCHIVE_GET_CMD ))
@@ -392,23 +409,6 @@ main(int argc, char *argv[])
392409}
393410}
394411
395- /*
396- * We read options from command line, now we need to read them from
397- * configuration file since we got backup path and instance name.
398- * For some commands an instance option isn't required, see above.
399- */
400- if (instance_name )
401- {
402- char path [MAXPGPATH ];
403-
404- /* Read environment variables */
405- config_get_opt_env (instance_options );
406-
407- /* Read options from configuration file */
408- join_path_components (path ,backup_instance_path ,BACKUP_CATALOG_CONF_FILE );
409- config_read_opt (path ,instance_options ,ERROR , true);
410- }
411-
412412/* Initialize logger */
413413init_logger (backup_path ,& instance_config .logger );
414414