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 Antworten
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.

beantwortet vor 2 Jahren
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.

Lwazi
beantwortet vor 2 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen