Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Avoid columns being displayed with their maximum width in the data output tab in pgAdmin

Tags:

pgadmin-4

In pgAdmin4 (version 5.5), when a SELECT * FROM tablename; query is executed, one can see on the bottom panel, under a tab called "Data Output", the resulting records for the selected columns for the specified table.

screenshot of the problem

If this table is having columns with very long string of data, e.g when encoded as JSON objects, or any PostGIS complex geometries, their width can be extraordinarily large, which affects the user experience negatively. Because going to some of the columns becomes a sub-pixel game when one try to grab and move the tiny horizontal slider (e.g. moving the slider half a pixel can move several columns by more than 2x the width of the screen...).

Did I miss something in the settings?
Is there a way to fix that, e.g. by setting a maximum width value for the columns? Because when using pgAdmin out-of-the-box, they are fully expanded...

I remember that is was not the case in earlier versions (4.x).

I'm using the latest dockerized version (5.5) as documented on the pgAdmin4 doc and available here: https://hub.docker.com/r/dpage/pgadmin4/

OS: Ubuntu 18.04
Web Browser: Firefox 89.0.2 (64-bit)

like image 876
s.k Avatar asked Aug 31 '25 15:08

s.k


2 Answers

You can set the maximum width value for columns under File -> Preferences -> Query tool -> Results grid

Max column width setting pgAdmin 4

max column width setting pgAdmin 4

like image 101
theDude Avatar answered Sep 04 '25 14:09

theDude


I am using PostgreSQL 11.17

  1. Go to File menu > click on Preferences
  2. From Preferences window scroll down to Query tool
  3. From the list under Query Tool > click on result grid
  4. Select Column name in the Columns sized by field
  5. Click save
  6. Reopen the table you were having issue with due to column width
like image 42
SS_Jin Avatar answered Sep 04 '25 14:09

SS_Jin