Using pgAdmin, how can I see the entire string value for a row when the value is very long?

For example, the value may be comma-separated values (CSV) content with hundreds or thousands of characters. Furthermore, the value may contain newline characters.

When doing queries in pgAdmin’s SQL tool, the results pane only shows a few dozen characters, and then suppresses the display of any more. Is there some way to see all of the text value?

Any way to export the results of a query to a text file or a text window perhaps?


2 Answers 2

  • Open pgAdminIII,

  • Select your database,

  • Use the Magnifying Glass button, i.e. "Execute arbitrary SQL queries"

  • Instead of running your query using the green triangle "Execute Query", choose the button two to the right of that - i.e. "Execute Query, write result to file".

  • Choose your destination, then you can view arbitrary length text in your chosen file destination.

  • You can also use psql which will show text, but will scroll if that's any use. Also, there would be the possibility of scripting your query output using different delimiters.

  • Thanks, that does work. Unfortunately, that feature seems to support only exporting as CSV. My stored value is already CSV text. That results in the quotes and such being doubled so as to escape them. So I cannot actually see my stored CSV in its original condition. Nov 19, 2015 at 3:14
  • Can't you use pipe (|) as a separator and then use sed (or vi or whatever) to remove the pipes - you could script it so you wouldn't have to manually intervene. Nov 19, 2015 at 3:20
  • Check here - a couple of methods to deal with this problem. And this might also be of interest. Ringer is on the PostgreSQL team and also contributes here. Nov 19, 2015 at 3:41

In PgAdmin, edit the value of Max. characters per column by following these steps :

File > Options > Query Editor > Max. characters per column

In some case you could find Query Tool instead of Query Editor.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.