pgadmin4 - Download Query result as CSV

StackAsk picture StackAsk · Jun 1, 2017 · Viewed 10.3k times · Source

I wrote a query using the query tool in pgadmin 4. Now I want to download the results as a csv. I´ve got two problems with that.

  1. The 'Download as CSV'-button does not work sometimes. Especially when the result contains 1000+ rows.

  2. When I finally have a csv and I want to open it, this message is all I see:

    "'ascii' codec can't encode character u'\xbb' in position 26: ordinal not in range(128)"

Since I´m fairly new to all of this, could someone enlighten me to what is wrong?

Answer

anthonydb picture anthonydb · Jun 1, 2017

On your questions:

  1. The broken CSV download was a known bug that was fixed in pgAdmin v1.5 (Bug summary at the login-required https://redmine.postgresql.org/issues/2253; the gist is that there were multiple issues with exporting JSON data and Unicode). If you're not on that version, try updating and see whether you continue to have the issue.
  2. You didn't specify where you're seeing that message regarding encoding, but the character referenced in the error is a "Right-Pointing Double Angle Quotation Mark" (») (http://www.codetable.net/hex/bb).