I'm trying to load data into Postgres RDS from S3 using the method aws_s3.table_import_from_s3
as explained here: Importing Data into PostgreSQL on Amazon RDS
The file path in S3 contains the equals sign '=' and because of it I'm getting the following error:
ERROR: HTTP 403. Permission denied. Check bucket or provided credentials as they may no longer be valid.
When replacing the equals sign with another character like underscore '_', the import succeeds.
Example:
SELECT aws_s3.table_import_from_s3(
'my_table',
'col1,col2',
'(format csv)',
'my_bucket',
'date=20191031/my_data.csv',
'eu-west-2'
);
Throws the error mentioned above. (HTTP 403...)
While:
SELECT aws_s3.table_import_from_s3(
'my_table',
'col1,col2',
'(format csv)',
'my_bucket',
'date_20191031/my_data.csv',
'eu-west-2'
);
Succeeds without any problem
Is there any escape char I should add to the equals sign? Any other solution?
I didn't test it, but should work. Just encode =
with %3D
.
SELECT aws_s3.table_import_from_s3(
'my_table',
'col1,col2',
'(format csv)',
'my_bucket',
'date%3D20191031/my_data.csv',
'eu-west-2');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With