Al usar AWS re:Post, aceptas las AWS re:Post Términos de uso

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

respondido hace 2 años
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.

respondido hace 2 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas