okbob / pspg

Unix pager (with very rich functionality) designed for work with tables. Designed for PostgreSQL, but MySQL is supported too. Works well with pgcli too. Can be used as CSV or TSV viewer too. It supports searching, selecting rows, columns, or block and export selected area to clipboard.
BSD 2-Clause "Simplified" License
2.43k stars 85 forks source link

Copy functionality trims leading whitespace #244

Closed dmfay closed 2 months ago

dmfay commented 2 months ago

I noticed this just now trying to copy a long query plan out (with "Copy All", on Linux and osx both) -- all the indentation is gone:

QUERY PLAN
Index Scan using thing_id_pkey on thing __local_0__  (cost=119.95..3500170.93 rows=1 width=320)
Index Cond: (id = 'fa0ed97d-0858-57c8-80f9-31434f76c9bd'::uuid)
Filter: (hashed SubPlan 25)
SubPlan 23
->  Index Scan using stuff_id_pkey on stuff stuff_2  (cost=2927.05..3500042.94 rows=1 width=32)
Index Cond: (id = __local_0__.stuff_id)
"Filter: ((hashed SubPlan 22) AND ....

I looked through export.c briefly but didn't see any obvious culprit.

okbob commented 2 months ago

čt 27. 6. 2024 v 20:54 odesílatel Dian Fay @.***> napsal:

I noticed this just now trying to copy a long query plan out (with "Copy All", on Linux and osx both) -- all the indentation is gone:

QUERY PLAN Index Scan using thing_id_pkey on thing local_0__ (cost=119.95..3500170.93 rows=1 width=320) Index Cond: (id = 'fa0ed97d-0858-57c8-80f9-31434f76c9bd'::uuid) Filter: (hashed SubPlan 25) SubPlan 23 -> Index Scan using stuff_id_pkey on stuff stuff_2 (cost=2927.05..3500042.94 rows=1 width=32) Index Cond: (id = local_0__.stuff_id) "Filter: ((hashed SubPlan 22) AND ....

I looked through export.c briefly but didn't see any obvious culprit.

maybe you use default csv format - it does trimming

try to use formatted text format instead, please

— Reply to this email directly, view it on GitHub https://github.com/okbob/pspg/issues/244, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEFO4ZRKEM7KPUNETNH5TLZJRNXJAVCNFSM6AAAAABKAPXWSGVHI2DSMVQWIX3LMV43ASLTON2WKOZSGM3TQOBYGY3DOOA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

dmfay commented 2 months ago

that worked, thank you!

okbob commented 2 months ago

čt 27. 6. 2024 v 21:00 odesílatel Dian Fay @.***> napsal:

that worked, thank you!

:-)

— Reply to this email directly, view it on GitHub https://github.com/okbob/pspg/issues/244#issuecomment-2195474037, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEFO464RKDXQ66BADJ4Y63ZJROOHAVCNFSM6AAAAABKAPXWSGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJVGQ3TIMBTG4 . You are receiving this because you commented.Message ID: @.***>