question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Option to intelligently enable pager based on output size (pset is not working)

See original GitHub issue

Description

It gets annoying that the pager is either on (set to less) or off (set to cat). When the query has a large number of output lines, it’s helpful to have the pager on, but when doing a bunch of small queries in preparation for a larger query, it’s helpful to have the pager off so you can see the query results in scrollback.

Would it be possible to have a pager option similar to \x auto that decides whether to use the pager based on the size of the output?

Your environment

  • OS: Mac OS 10.12.6
  • pgcli version: 1.8.1

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
maxrothmancommented, Dec 15, 2017

I’m looking for pgcli to implement the same behavior for \pset pager that psql has. For example, in psql:

postgres> \pset pager on
postgres> SELECT table_name from information_schema.tables;
...pager used...
postgres> SELECT table_name from information_schema.tables LIMIT 1;
...pager not used...

As expected, with \pset pager always, the pager is always used, and with \pset pager off, the pager is never used. In cases where the pager is used, whether the screen is cleared or not afterwards depends on the pager. In cases where it is not, the pager is never invoked.

However, \pset pager seems to be completely ignored by pgcli:

postgres> \pset pager off
postgres> SELECT table_name from information_schema.tables LIMIT 1;
...pager used...

So perhaps this issue would be more accurately titled “pgcli ignores \pset pager value”?

2reactions
j-bennetcommented, Nov 6, 2017

@maxrothman export LESS=-XFR may help here. See this for more information.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I prevent 'git diff' from using a pager? - Stack Overflow
--no-pager to Git will tell it to not use a pager. Passing the option -F to less will tell it to not page...
Read more >
Auto Layout Guide: Working with Constraints in Interface Builder
Interface Builder intelligently selects the set of constraints based on the items you are constraining and the direction of your drag ...
Read more >
How to make "screen length" or "no page" permanent? | Wired ...
I have tried both the screen length and no page commands and neither one seems. ... You need to have enable access to...
Read more >
axe DevTools | Developer Tools for Accessibility Testing
Integrate accessibility testing into your existing automated testing process with axe DevTools. Toolkits available for web, iOS and Android.
Read more >
Configure Monitors - Datadog Docs
To start configuring the monitor, complete the following: Define the search query: Construct a query to count events, measure metrics, group by one...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found