@@ -164,12 +164,6 @@ int64 ttl = -1;
164164static char * expire_time_string = NULL ;
165165static pgSetBackupParams * set_backup_params = NULL ;
166166
167- #ifdef PBCKP_S3
168- /* S3 options */
169- S3_protocol s3_protocol ;
170- char * s3_target_bucket = NULL ;
171- #endif
172-
173167/* ================ backupState =========== */
174168static char * backup_id_string = NULL ;
175169pgBackup current ;
@@ -180,9 +174,6 @@ static bool help_opt = false;
180174static void opt_incr_restore_mode (ConfigOption * opt , const char * arg );
181175static void opt_backup_mode (ConfigOption * opt , const char * arg );
182176static void opt_show_format (ConfigOption * opt , const char * arg );
183- #ifdef PBCKP_S3
184- static void opt_s3_protocol (ConfigOption * opt , const char * arg );
185- #endif
186177
187178static void compress_init (ProbackupSubcmd const subcmd );
188179
@@ -279,12 +270,6 @@ static ConfigOption cmd_options[] =
279270 { 'I' , 170 , "ttl" , & ttl , SOURCE_CMD_STRICT , SOURCE_DEFAULT , 0 , OPTION_UNIT_S , option_get_value },
280271 { 's' , 171 , "expire-time" , & expire_time_string , SOURCE_CMD_STRICT },
281272
282- #ifdef PBCKP_S3
283- /* S3 options */
284- { 'f' , 245 , "s3" , opt_s3_protocol , SOURCE_CMD_STRICT },
285- { 's' , 246 , "target-bucket" , & s3_target_bucket , SOURCE_CMD_STRICT },
286- #endif
287-
288273 /* options for backward compatibility
289274 * TODO: remove in 3.0.0
290275 */
@@ -974,19 +959,6 @@ main(int argc, char *argv[])
974959
975960 compress_init (backup_subcmd );
976961
977- #ifdef PBCKP_S3
978- if (s3_protocol != S3_INVALID_PROTOCOL )
979- {
980- char * s3_config_file = "" ;
981- read_s3_config (s3_config_file );
982- }
983- else
984- {
985- if (s3_target_bucket != NULL )
986- elog (WARNING , "You cannot specify s3-target without using --s3 option with name of protocol" );
987- }
988- #endif
989-
990962 /* do actual operation */
991963 switch (backup_subcmd )
992964 {
@@ -1002,10 +974,6 @@ main(int argc, char *argv[])
1002974 {
1003975 int err = 0 ;
1004976 err = do_add_instance (instanceState , & instance_config );
1005- #ifdef PBCKP_S3
1006- if (err == 0 && s3_protocol != S3_INVALID_PROTOCOL )
1007- err = do_S3_write_config (instanceState );
1008- #endif
1009977 return err ;
1010978 }
1011979 case DELETE_INSTANCE_CMD :
@@ -1014,10 +982,6 @@ main(int argc, char *argv[])
1014982 {
1015983 int err = 0 ;
1016984 err = do_init (catalogState );
1017- #ifdef PBCKP_S3
1018- if (err == 0 && s3_protocol != S3_INVALID_PROTOCOL )
1019- err = S3_pre_start_check (config );
1020- #endif
1021985 return err ;
1022986 }
1023987 case BACKUP_CMD :
@@ -1034,21 +998,13 @@ main(int argc, char *argv[])
1034998 elog (ERROR , "required parameter not specified: BACKUP_MODE "
1035999 "(-b, --backup-mode)" );
10361000
1037- #ifdef PBCKP_S3
1038- if (s3_protocol != S3_INVALID_PROTOCOL )
1039- return do_S3_backup (instanceState , set_backup_params , start_time );
1040- #endif
10411001 return do_backup (instanceState , set_backup_params ,
10421002 no_validate , no_sync , backup_logs , start_time );
10431003 }
10441004 case CATCHUP_CMD :
10451005 return do_catchup (catchup_source_pgdata , catchup_destination_pgdata , num_threads , !no_sync ,
10461006 exclude_absolute_paths_list , exclude_relative_paths_list );
10471007 case RESTORE_CMD :
1048- #ifdef PBCKP_S3
1049- if (s3_protocol != S3_INVALID_PROTOCOL )
1050- return do_S3_restore (instanceState , current .backup_id );
1051- #endif
10521008 return do_restore_or_validate (instanceState , current .backup_id ,
10531009 recovery_target_options ,
10541010 restore_params , no_sync );
@@ -1068,10 +1024,6 @@ main(int argc, char *argv[])
10681024 restore_params ,
10691025 no_sync );
10701026 case SHOW_CMD :
1071- #ifdef PBCKP_S3
1072- if (s3_protocol != S3_INVALID_PROTOCOL )
1073- return do_S3_show (instanceState );
1074- #endif
10751027 return do_show (catalogState , instanceState , current .backup_id , show_archive );
10761028 case DELETE_CMD :
10771029
@@ -1259,35 +1211,4 @@ opt_exclude_path(ConfigOption *opt, const char *arg)
12591211 opt_parser_add_to_parray_helper (& exclude_absolute_paths_list , arg );
12601212 else
12611213 opt_parser_add_to_parray_helper (& exclude_relative_paths_list , arg );
1262- }
1263-
1264- #ifdef PBCKP_S3
1265- static S3_protocol
1266- parse_s3_protocol (const char * value )
1267- {
1268- const char * v = value ;
1269- size_t len ;
1270-
1271- /* Skip all spaces detected */
1272- while (IsSpace (* v ))
1273- v ++ ;
1274- len = strlen (v );
1275-
1276- if (len > 0 && pg_strncasecmp ("MINIO" , v , len ) == 0 )
1277- return S3_MINIO_PROTOCOL ;
1278- if (len > 0 && pg_strncasecmp ("AWS" , v , len ) == 0 )
1279- return S3_AWS_PROTOCOL ;
1280- else if (len > 0 && pg_strncasecmp ("GOOGLE" , v , len ) == 0 )
1281- return S3_GOOGLE_PROTOCOL ;
1282- else if (len > 0 && pg_strncasecmp ("VK" , v , len ) == 0 )
1283- return S3_VK_PROTOCOL ;
1284- else
1285- return S3_INVALID_PROTOCOL ;
1286- }
1287-
1288- static void
1289- opt_s3_protocol (ConfigOption * opt , const char * arg )
1290- {
1291- s3_protocol = parse_s3_protocol (arg );
1292- }
1293- #endif
1214+ }
0 commit comments