swiss_knight
swiss_knight

Reputation: 7821

Unable to export PostgreSQL table to CSV file in pgAdmin4: environment can only contain strings

When right clicking on a PostgreSQL table within pgAdmin 4 version 5.3, I set up these parameters to export it to a CSV file:

export to csv parameters

But when I click OK, this error is showing: "Import/Export job failed: environment can only contain strings" for which I absolutely don't know what to do (and also where does it come from):

pgAdmin4 error message popup

How to solve this error?

It only appears on a Windows 10 OS. I never faced this issue on Ubuntu e.g.

Upvotes: 2

Views: 1238

Answers (1)

FireEmerald
FireEmerald

Reputation: 1370

The error message shown by pgAdmin is misleading here and doesn't help.

PgAdmin uses pg_dump and other tools to perform certain actions like Import/Export or Backup. Before starting these external processes pgAdmin sets environmental variables for example:

'PGSSLMODE': 'disable'  # Correct env variable
'PGSSLCERT': None       # Malformed env variable, missing ''

Your issue is now that one of these variables is set incorrectly by pgAdmin and thus is malformed. Malformed means for example the quotes are missing like shown above. A env variable needs to be quoted.

Possible error cause:

You configured "Client certificate", "Client certificate key" and "Root certificate" inside the "SSL" tab of your connection and at least one of those files does NOT exist anymore, then your error will be shown.

1

I reported this bug/bad error handling here (requires a free forum account to view).

Upvotes: 1

Related Questions