Allwin
Allwin

Reputation: 2216

While unloading the table to s3 the database gets restarted

I'm trying to unload a table to S3, whenever I'm trying I would get below message.

FATAL: A fatal error occurred. The database will be restarted. SSL SYSCALL error: EOF detected The connection to the server was lost. Attempting reset: Failed.

query= UNLOAD (' select * from public.table ') to 's3://bucket/path/in/s3/' credentials 'aws_access_key_id=####;aws_secret_access_key=####' delimiter '\t' GZIP PARALLEL ON ALLOWOVERWRITE NULL AS 'M15sInGValue57ring' ESCAPE ADDQUOTES;

Upvotes: 1

Views: 457

Answers (1)

Allwin
Allwin

Reputation: 2216

NULL AS string cannot be longer than 18 characters.

UNLOAD (' select * from public.table ') to 's3://bucket/path/in/s3/' credentials 'aws_access_key_id=####;aws_secret_access_key=####' delimiter '\t' GZIP PARALLEL ON ALLOWOVERWRITE NULL AS 'M15sInG57ring' ESCAPE ADDQUOTES;

It works !!!

Reason Why it Failed?

  • Whenever null encounters while unloading, it would replace with NULL AS string.
  • There it expects it to be lesser than 18 characters. Otherwise while converting, it would fail.
  • So that DB restart occurs.

Upvotes: 1

Related Questions