7

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?

Basil Bourque
  • 10,806
  • 20
  • 59
  • 92
  • Why do you want to see such a big something? Is it really there for human consumption? – András Váczi Nov 19 '15 at 09:20
  • http://stackoverflow.com/questions/31828182/incomplete-information-from-query-on-pg-views –  Nov 19 '15 at 19:13
  • http://dave.webdev.pgadmin.org/support/faq.php#ColTrunc –  Nov 19 '15 at 19:14
  • you can also copy and paste the output cell to say notepad to view it. it's a PITA I agree – Neil McGuigan Nov 19 '15 at 21:00
  • @NeilMcGuigan Nope, copy-paste of the cell does not work. You get a chunk, but the rest of the text is truncated, replaced by a pseudo-ellipsis. For example, the tail look like this: "11.21","8,11 (...)" – Basil Bourque Nov 20 '15 at 01:09

2 Answers2

9
  • 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.

Vérace
  • 29,825
  • 9
  • 70
  • 84
  • 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. – Basil Bourque Nov 19 '15 at 03: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. – Vérace Nov 19 '15 at 03: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. – Vérace Nov 19 '15 at 03:41
1

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.

Kamal SABBAR
  • 111
  • 3