@@ -164,12 +164,6 @@ int64 ttl = -1;
164
164
static char * expire_time_string = NULL ;
165
165
static pgSetBackupParams * set_backup_params = NULL ;
166
166
167
- #ifdef PBCKP_S3
168
- /* S3 options */
169
- S3_protocol s3_protocol ;
170
- char * s3_target_bucket = NULL ;
171
- #endif
172
-
173
167
/* ================ backupState =========== */
174
168
static char * backup_id_string = NULL ;
175
169
pgBackup current ;
@@ -180,9 +174,6 @@ static bool help_opt = false;
180
174
static void opt_incr_restore_mode (ConfigOption * opt , const char * arg );
181
175
static void opt_backup_mode (ConfigOption * opt , const char * arg );
182
176
static 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
186
177
187
178
static void compress_init (ProbackupSubcmd const subcmd );
188
179
@@ -279,12 +270,6 @@ static ConfigOption cmd_options[] =
279
270
{ 'I' , 170 , "ttl" , & ttl , SOURCE_CMD_STRICT , SOURCE_DEFAULT , 0 , OPTION_UNIT_S , option_get_value },
280
271
{ 's' , 171 , "expire-time" , & expire_time_string , SOURCE_CMD_STRICT },
281
272
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
-
288
273
/* options for backward compatibility
289
274
* TODO: remove in 3.0.0
290
275
*/
@@ -974,19 +959,6 @@ main(int argc, char *argv[])
974
959
975
960
compress_init (backup_subcmd );
976
961
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
-
990
962
/* do actual operation */
991
963
switch (backup_subcmd )
992
964
{
@@ -1002,10 +974,6 @@ main(int argc, char *argv[])
1002
974
{
1003
975
int err = 0 ;
1004
976
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
1009
977
return err ;
1010
978
}
1011
979
case DELETE_INSTANCE_CMD :
@@ -1014,10 +982,6 @@ main(int argc, char *argv[])
1014
982
{
1015
983
int err = 0 ;
1016
984
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
1021
985
return err ;
1022
986
}
1023
987
case BACKUP_CMD :
@@ -1034,21 +998,13 @@ main(int argc, char *argv[])
1034
998
elog (ERROR , "required parameter not specified: BACKUP_MODE "
1035
999
"(-b, --backup-mode)" );
1036
1000
1037
- #ifdef PBCKP_S3
1038
- if (s3_protocol != S3_INVALID_PROTOCOL )
1039
- return do_S3_backup (instanceState , set_backup_params , start_time );
1040
- #endif
1041
1001
return do_backup (instanceState , set_backup_params ,
1042
1002
no_validate , no_sync , backup_logs , start_time );
1043
1003
}
1044
1004
case CATCHUP_CMD :
1045
1005
return do_catchup (catchup_source_pgdata , catchup_destination_pgdata , num_threads , !no_sync ,
1046
1006
exclude_absolute_paths_list , exclude_relative_paths_list );
1047
1007
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
1052
1008
return do_restore_or_validate (instanceState , current .backup_id ,
1053
1009
recovery_target_options ,
1054
1010
restore_params , no_sync );
@@ -1068,10 +1024,6 @@ main(int argc, char *argv[])
1068
1024
restore_params ,
1069
1025
no_sync );
1070
1026
case SHOW_CMD :
1071
- #ifdef PBCKP_S3
1072
- if (s3_protocol != S3_INVALID_PROTOCOL )
1073
- return do_S3_show (instanceState );
1074
- #endif
1075
1027
return do_show (catalogState , instanceState , current .backup_id , show_archive );
1076
1028
case DELETE_CMD :
1077
1029
@@ -1259,35 +1211,4 @@ opt_exclude_path(ConfigOption *opt, const char *arg)
1259
1211
opt_parser_add_to_parray_helper (& exclude_absolute_paths_list , arg );
1260
1212
else
1261
1213
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