Skip to content
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

Problems with certain commands #2

Closed
jmafc opened this issue Jul 16, 2017 · 15 comments
Closed

Problems with certain commands #2

jmafc opened this issue Jul 16, 2017 · 15 comments

Comments

@jmafc
Copy link

jmafc commented Jul 16, 2017

If used with \?, the screen is blank (except for the Quit 0..4 C.Freeze) at the bottom. If I press PageDown it's still blank, but when I press it again, I get to see the last 2/3 or 3/4 of the output. I also get a mostly blank screen when using \d on some tables with many columns and constraints/triggers (for example, it only shows the first line of a textsearch trigger, but it does show a blank inverse video, cursor line, that can be moved with the arrow keys).

@okbob
Copy link
Owner

okbob commented Jul 16, 2017

It is possible. I tested it on only simple SELECTs. I should to enhance mode, when it is used like normal pager.

okbob added a commit that referenced this issue Jul 16, 2017
@okbob
Copy link
Owner

okbob commented Jul 16, 2017

Please, try it again. If it dosn't work, please, attach output of you \d command. Please, use \o somefile.
What is your \pset setting? I am testing \d pg_class without any issue. This pager works better with \pset border 2 setting.

@okbob
Copy link
Owner

okbob commented Jul 16, 2017

There is some random issue. Sometimes I got a empty result too. But repeated command (sometimes 5x) helps. It will need some deeper research (looks like problems with reading from stdin :()
\h doesn't work well too.
This is prototype - two weeks old. +/- I am testing my ideas.

@loveencounterflow
Copy link

\? works for me...

@okbob
Copy link
Owner

okbob commented Jul 16, 2017

I have problems with ncurses pad resizing - sometimes it doesn't working and some data are lost. When I disable pad resizing and initial size of pad "rows" is enough dimensioned, then all is working.

@jmafc
Copy link
Author

jmafc commented Jul 16, 2017

I understand it's a prototype. I think it's great for its main intended use: scrolling horizontally and vertically across relational data (I had given up on using the pager, if I need to scroll I typically use Adminer). The problem with \? and \d is the output is not entirely relational. For example, the top of \d is relational, but the extra stuff, i.e., indexes, foreign-key constraints, etc., is not and pspg gets confused, e.g., the characters that are under the first column are displayed in yellow, then there's a character column in white, then a character column in yellow and the rest in white again. And you don't really want to horizontally scroll that bottom part, even though you want to scroll to see some long modifier on the top.

@okbob
Copy link
Owner

okbob commented Jul 16, 2017

sure. Scrolling bottom bar should not be easy when the wide is longer than screen. I had a idea, how to design it - but first I have to fix strange "pad" resizing. Additional issue related to bottom part is a bottom part detection. I am able do it only when there is outer border. Maybe there can be some detection based on finding and analysing a rivers in text.

@okbob
Copy link
Owner

okbob commented Jul 24, 2017

I fix some issues. Please, check it.

@jmafc
Copy link
Author

jmafc commented Jul 25, 2017

The make all fails because there is no pg_proc.txt file in the directory.

@jmafc
Copy link
Author

jmafc commented Jul 25, 2017

The problems that I reported initially appear to have been fixed, so you can close the issue as far as I'm concerned. Although the horizontal/vertical scrolling features are nice, I doubt that I can use this on a regular basis. Unfortunately, to use it, you need to change the value of PAGER which interferes with commands like man.

@davemichels
Copy link

davemichels commented Jul 25, 2017

The pg_proc.txt issue was introduced on commit ff1858f when the FILENAME define was changed from pg_class.txt to pg_proc.txt on line 14. The issue isn't with make, its with pager -d(emo).

On that note, the error fprintf for -d on line 835 needs a trailing \n. The error fprintf for the -f option on line 843 also needs a \n and is also misreporting the missing filename (using the FILENAME define instead of optarg).

Above line numbers are based on fe7d386.

@okbob
Copy link
Owner

okbob commented Jul 26, 2017

@davemichels should be fixed by last commit

@okbob
Copy link
Owner

okbob commented Jul 26, 2017

@jmafc You can use \setenv command and set PAGER variable just for current psql. This command can be saved in .psqlrc file

\setenv PAGER ./psql
SELECT * FROM pg_class;

Attention: I renamed binary from pager to pspg.

@jmafc
Copy link
Author

jmafc commented Jul 27, 2017

OK, adding setenv PAGER in the .psqlrc works. However, having to use PageDown/PageUp is a "regression": Space (or f) for scroll forward and b for scroll backward would be better so that one doesn't have to leave the main keys. As far as scrolling horizontally, I don't quite like the less selections (ESC-( and ESC-)). I'd rather have a Ctrl-<letter> command. Another, perhaps bigger, regression is not being able to search with /. so as I said, I'll probably can't use it on a regular basis.

@okbob
Copy link
Owner

okbob commented Aug 12, 2017

now, '/' searching is supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants