Usando AWS re:Post, accetti AWS re:Post Termini di utilizzo

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

con risposta 2 anni fa
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.

con risposta 2 anni fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande