Re: Query results display of text with leading spaces? - Mailing list pgadmin-support

From Aditya Toshniwal
Subject Re: Query results display of text with leading spaces?
Date
Msg-id CAM9w-_mxCJKRfkho0q3EXtFWif=fmueOqUNvLvXX0wH-_tku1A@mail.gmail.com
Whole thread Raw
In response to Re: Query results display of text with leading spaces?  (Aditya Toshniwal <aditya.toshniwal@enterprisedb.com>)
List pgadmin-support
Hi Carl,

This looks like a bug. I should have mentioned to report this on https://github.com/pgadmin-org/pgadmin4/issues. My bad.
Can you please raise it to the above link, so that it can be tracked and fixed?

On Tue, Jan 31, 2023 at 2:57 AM Carl Sopchak <carl@sopchak.me> wrote:

Thanks for the quick reply.  Sorry, should have done that! :-)

This is what I see in psql:

This is what I see in pgAdmin:

I am looking for the val_formatted column to be right-justified so the digits line up by place value, as is done in psql.

Even if I add a printable character at the start of the string, they do not line up (while not ideal, it's sufficient for my purpose):

So I'm not sure what's going on, other than it seems pgAdmin playing with the data being returned by the database, or there's something about the font used that makes the size of more than one space look like it's only one.  In either case, I am not seeing what's in the database, which IMHO is unacceptable for a tool such as this.  You can always code to handle things like this if that's how you want it displayed.  Interestingly, if I copy the value in the results to the query pane I see the spaces:

Let me know if any other information would be helpful.  To make it as easy as possible for you, here's the query:

select val, 'x' || to_char(val, '9,999,999,999') as val_formatted
from ( values (123),(12345678) ) vals(val);


Thanks again for the help.

Carl

On 1/30/23 00:06, Aditya Toshniwal wrote:
Hi Carl,

It is difficult to understand what is expected. If you can explain with some screenshots then that would be helpful.

On Mon, Jan 30, 2023 at 2:22 AM Carl Sopchak <carl@sopchak.me> wrote:

It appears to me that text columns of a query result with leading spaces in a text column have the leading spaces stripped in the query tool's Data Output tab.  When I copy/paste a cell's value into a text editor it shows the leading spaces.  How do I get pgAdmin to not fully left justify the value upon display?  My purpose is an effort to add commas to an integer value to make it easier to read, but keeping the value right-justified in the column displayed so place digits align (although I can envision many other uses where leading spaces would be significant).

How can I do that?  Is it a font issue (how do I change the font?), or is it something pgAdmin is doing upon display (can it be turned off?)?

pgAdmin4 6.19 on Fedora Linux 37 (fully up-to-date).  I tried searching the archives ("leading spaces" among others) but came up empty...

Thanks for the help,

Carl



--
Thanks,
Aditya Toshniwal
pgAdmin Hacker | Software Architect | edbpostgres.com
"Don't Complain about Heat, Plant a TREE"


--
Thanks,
Aditya Toshniwal
pgAdmin Hacker | Software Architect | edbpostgres.com
"Don't Complain about Heat, Plant a TREE"
Attachment

pgadmin-support by date:

Previous
From: Aditya Toshniwal
Date:
Subject: Re: Query results display of text with leading spaces?
Next
From: Joe Tailleur
Date:
Subject: pgAdmin 6.19 - Hotkey for opening Query Window not working