Can an S3 import into RDS table be forced to success using an empty file?

0

I am running the following script to load an S3 file into my Postgres table. When the file has data everything works as expected, however if I receive an empty file it fails. Is there anyway to override the failure, as we will expect an empty file periodically.

SELECT aws_s3.table_import_from_s3( 'exprt.invoices_all', '', '(format csv, header true)', aws_commons.create_s3_uri('exprt-S3', 'ImportFiles/INVOICES_ALL.txt', 'us-east-1') );

2 個答案
0

Is the file empty or does the file not exist? If they file is empty I would expect it to just return 0 rows as a success.

已回答 3 年前
0

Hi, I understand you are trying to import data into a table and that is basically inserting data, your statement fail due to the fact you can't insert null values into a table.

已回答 3 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南