-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[enhancement] Ignore column by name #135
Comments
It is interesting task, but it is not simply - because Postgres is pager only and usually just display content formatted by another application, I think it can be possible to implement in CSV format, where pspg does formatting too. |
I implemented proof concept - final solution (more dynamic) needs significantly more work. But I think so this "initial" design can be useful too - with some psql ":" macros: \setenv PSPG '--csv-header on --skip-columns-like=okres_id --csv' \pset format csv select ... \unset PSPG Please check |
Wildcards are not supported, but by default substring test is used. It can be changed by RE symbols ^ or $. |
Thanks, it works! |
Hehe, another enhancement: maybe add a list? Edit: |
út 5. 5. 2020 v 13:29 odesílatel tobwen <notifications@github.com> napsal:
Hehe, another enhancement: maybe add a list? --skip-columns-like=a,b,c
it can be list - separator is a space
…--skip-columns-like=" a b c"
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#135 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEFO4YVSYV3ZA4WH2KINNTRP72AZANCNFSM4MYP43TA>
.
|
Thank you for pizza :) |
Interesting, it stopped working after an upgrade. psql (PostgreSQL) 12.6 just displays plain, comma-separated CSV data (including the ignored columns).
Did something change in pspg or psql? My pspg version:
|
Hi
čt 15. 4. 2021 v 0:43 odesílatel tobwen ***@***.***> napsal:
Interesting, it somehow stopped working. *psql (PostgreSQL) 12.6* just
displays CSV data (including the ignored columns).
\setenv PAGER 'pspg -bXI --less-status-bar --csv --csv-header on --skip-columns-like=geom'
\pset format csv
select ...
Did something change in *pspg* or *psql*?
I am testing the master version of pspg and psql for Postgres 14 and it is
working.
You can try to set PSQL_PAGER - it has bigger priority
\setenv PSQL_PAGER 'pspg -bXI --less-status-bar --csv --csv-header on
--skip-columns-like=reln'
\pset format csv
select * from pg_class ;
and relname and relnamespace is hidden
Regards
Pavel
—
… You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#135 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEFO4Y3HH6EGYHQXP7BZI3TIYLBNANCNFSM4MYP43TA>
.
|
tl;dr of the request
It would be great to ignore columns by name with wildcards like this:
pspg --ignore-columns '*geom*'
background
I'm using pspg as pager inside PostgreSQL (good work!) and I'm working with geodata. The pager, of course, tries to display the binary geodata column, when doing a
SELECT * FROM table
. When this column is at the very beginning, the user needs to right-scroll for a while.Instead of selecting every single column (PostgreSQL doesn't allow
SELECT *, -geom
), it would be very nice to just ignore the column. Additional setup, activation, and de-activation via menu would be the ultimate solution.The text was updated successfully, but these errors were encountered: