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 réponses
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.

répondu il y a 3 ans
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.

répondu il y a 3 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions