public inbox for [email protected]
help / color / mirror / Atom feedWhat is paging my psql
12+ messages / 5 participants
[nested] [flat]
* What is paging my psql
@ 2025-11-20 14:16 lejeczek <[email protected]>
2025-11-20 14:36 ` Re: What is paging my psql David G. Johnston <[email protected]>
2025-11-20 19:02 ` Re: What is paging my psql Laurenz Albe <[email protected]>
0 siblings, 2 replies; 12+ messages in thread
From: lejeczek @ 2025-11-20 14:16 UTC (permalink / raw)
To: [email protected]
Hi guys.
I have virtually identical 3 servers and one is paging the
output.
-> $ psql --port=5437 -c '\pset pager'
Pager usage is off.
there is no PAGER nor any other, obvious OS evn var set, yet
I do simple query which shows a few lines, eg.
-> $ psql --port=5437 --dbname=upa_discourse -c 'select *
from pg_extension;'
and the output is paged, waiting for 'q' from user to go
back to shell.
I could not find any psqlrc neither - and the other two
servers do not that, to make more bizarre.
Would you know where is it coming from and how to fix it
permanently - ideally not by adding stuff but by figuring
out why it is the two servers do page and then fixing the
odd one same way.
I'm on Ubuntu 22.04 with ver 16 of PG.
thanks, L.
^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: What is paging my psql
2025-11-20 14:16 What is paging my psql lejeczek <[email protected]>
@ 2025-11-20 14:36 ` David G. Johnston <[email protected]>
2025-11-21 09:40 ` Re: What is paging my psql lejeczek <[email protected]>
2025-11-21 09:43 ` Re: What is paging my psql lejeczek <[email protected]>
1 sibling, 2 replies; 12+ messages in thread
From: David G. Johnston @ 2025-11-20 14:36 UTC (permalink / raw)
To: lejeczek <[email protected]>; +Cc: [email protected] <[email protected]>
On Thursday, November 20, 2025, lejeczek <[email protected]> wrote:
>
>
> I have virtually identical 3 servers and one is paging the output.
>
> -> $ psql --port=5437 -c '\pset pager'
> Pager usage is off.
>
You just demonstrated that the psql running on this client uses the pager
by default. Since by executing pset pager you turned it off.
The server being connected to should not play a role. You’ll need a better
example if you claim otherwise.
David J.
^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: What is paging my psql
2025-11-20 14:16 What is paging my psql lejeczek <[email protected]>
2025-11-20 14:36 ` Re: What is paging my psql David G. Johnston <[email protected]>
@ 2025-11-21 09:40 ` lejeczek <[email protected]>
2025-11-21 13:34 ` Re: What is paging my psql David G. Johnston <[email protected]>
1 sibling, 1 reply; 12+ messages in thread
From: lejeczek @ 2025-11-21 09:40 UTC (permalink / raw)
To: ; +Cc: [email protected] <[email protected]>
All three servers show the same:
-> $ psql --port=5437 -c '\pset' | egrep -i pager
pager 1
pager_min_lines 0
Two of them do not page the query I showed
-> $ psql --port=5438 --dbname=yja_discourse -c 'select *
from pg_extension;'
oid | extname | extowner | extnamespace |
extrelocatable | extversion | extconfig | extcondition
-------+----------+----------+--------------+----------------+------------+-----------+--------------
13545 | plpgsql | 10 | 11 | f
| 1.0 | |
16393 | hstore | 10 | 2200 | t
| 1.8 | |
16521 | pg_trgm | 10 | 2200 | t
| 1.6 | |
16602 | unaccent | 10 | 2200 | t
| 1.1 | |
61507 | vector | 10 | 2200 | t
| 0.8.1 | |
(5 rows)
third server pages - waits for user 'q' to switch back to
shell prompt.
None of the servers - no that I could find - has $PAGER nor
$PSQL_PAGER nor $SYSTEMD_PAGER set.
In fact:
-> $ set | egrep -i page
-> $ env | egrep -i page
shows nothing.
None of the servers - I failed to find - has psqlrc, not for
the user nor system-wide.
On the two non-paging servers with this:
-> $ psql --port=5437 -c '\pset pager on'
Pager is used for long output.
done, the above query does not page - for the output is not
long enough I believe.
On the third paging server - that does not change behaviour
neither.
But I also noticed that after 'on/off' - this does not
change and remains:
-> $ psql --port=5437 -c '\pset' | egrep -i pager
pager 1
pager_min_lines 0
Should that change/setting not be permanent, at least for
the session-time being?
thanks, L.
^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: What is paging my psql
2025-11-20 14:16 What is paging my psql lejeczek <[email protected]>
2025-11-20 14:36 ` Re: What is paging my psql David G. Johnston <[email protected]>
2025-11-21 09:40 ` Re: What is paging my psql lejeczek <[email protected]>
@ 2025-11-21 13:34 ` David G. Johnston <[email protected]>
2025-11-21 15:16 ` Re: What is paging my psql Tom Lane <[email protected]>
2025-11-21 17:55 ` Re: What is paging my psql lejeczek <[email protected]>
0 siblings, 2 replies; 12+ messages in thread
From: David G. Johnston @ 2025-11-21 13:34 UTC (permalink / raw)
To: lejeczek <[email protected]>; +Cc: [email protected] <[email protected]>
On Friday, November 21, 2025, lejeczek <[email protected]> wrote:
>
> All three servers show the same:
> -> $ psql --port=5437 -c '\pset' | egrep -i pager
> pager 1
> pager_min_lines 0
>
Everything seems to be working as intended. You just seem to have
incorrect expectations.
Whether the pager is used is conditioned on actual output data.
pset controls client settings and those are never “saved”. They have their
default values and a psqlrc file if you wish to change them during program
startup.
David J.
^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: What is paging my psql
2025-11-20 14:16 What is paging my psql lejeczek <[email protected]>
2025-11-20 14:36 ` Re: What is paging my psql David G. Johnston <[email protected]>
2025-11-21 09:40 ` Re: What is paging my psql lejeczek <[email protected]>
2025-11-21 13:34 ` Re: What is paging my psql David G. Johnston <[email protected]>
@ 2025-11-21 15:16 ` Tom Lane <[email protected]>
1 sibling, 0 replies; 12+ messages in thread
From: Tom Lane @ 2025-11-21 15:16 UTC (permalink / raw)
To: David G. Johnston <[email protected]>; +Cc: lejeczek <[email protected]>; [email protected] <[email protected]>
"David G. Johnston" <[email protected]> writes:
> Whether the pager is used is conditioned on actual output data.
IIRC, you can do "\pset pager always" if you want the pager to be
invoked regardless of the query output length.
Be aware though that the default pager is "more", which (at least
on my Linux box) silently does nothing special if the output is less
than a screenful. If the behavior you are looking for is "wait for
a keystroke even after very short output", you'd need to combine the
\pset setting with "export PSQL_PAGER=less" or similar.
regards, tom lane
^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: What is paging my psql
2025-11-20 14:16 What is paging my psql lejeczek <[email protected]>
2025-11-20 14:36 ` Re: What is paging my psql David G. Johnston <[email protected]>
2025-11-21 09:40 ` Re: What is paging my psql lejeczek <[email protected]>
2025-11-21 13:34 ` Re: What is paging my psql David G. Johnston <[email protected]>
@ 2025-11-21 17:55 ` lejeczek <[email protected]>
2025-11-21 18:55 ` Re: What is paging my psql Tom Lane <[email protected]>
2025-11-21 19:15 ` Re: What is paging my psql David G. Johnston <[email protected]>
1 sibling, 2 replies; 12+ messages in thread
From: lejeczek @ 2025-11-21 17:55 UTC (permalink / raw)
To: ; +Cc: [email protected] <[email protected]>
gee zuss boy...
I at this point begin to wonder if you guys - those who
replied - even read what I/people say or.. you just take the
piss.
I've only been trying to show that three boxes I have, with
virtually the same settings, same env, same (absent!) shell
vars, behave differently when they show _same_ output for
the _same_ simple query.
What expectations? expectations about what?
I'm only trying to investigate & understand why that is that
one box does - what I under is "paging" of a short output -
whereas other two do _not_ that.
The _but_ here is - obviously - that between that 1 box VS 2
other boxes, there must be a difference(s) somewhere... but
! where?
thanks, L.
^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: What is paging my psql
2025-11-20 14:16 What is paging my psql lejeczek <[email protected]>
2025-11-20 14:36 ` Re: What is paging my psql David G. Johnston <[email protected]>
2025-11-21 09:40 ` Re: What is paging my psql lejeczek <[email protected]>
2025-11-21 13:34 ` Re: What is paging my psql David G. Johnston <[email protected]>
2025-11-21 17:55 ` Re: What is paging my psql lejeczek <[email protected]>
@ 2025-11-21 18:55 ` Tom Lane <[email protected]>
1 sibling, 0 replies; 12+ messages in thread
From: Tom Lane @ 2025-11-21 18:55 UTC (permalink / raw)
To: lejeczek <[email protected]>; +Cc: [email protected] <[email protected]>
lejeczek <[email protected]> writes:
> I've only been trying to show that three boxes I have, with
> virtually the same settings, same env, same (absent!) shell
> vars, behave differently when they show _same_ output for
> the _same_ simple query.
[ shrug... ] So there is something different about those boxes.
We have less information about that than you do. Have you
checked ~/.psqlrc on all three?
regards, tom lane
^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: What is paging my psql
2025-11-20 14:16 What is paging my psql lejeczek <[email protected]>
2025-11-20 14:36 ` Re: What is paging my psql David G. Johnston <[email protected]>
2025-11-21 09:40 ` Re: What is paging my psql lejeczek <[email protected]>
2025-11-21 13:34 ` Re: What is paging my psql David G. Johnston <[email protected]>
2025-11-21 17:55 ` Re: What is paging my psql lejeczek <[email protected]>
@ 2025-11-21 19:15 ` David G. Johnston <[email protected]>
2025-11-21 19:17 ` Re: What is paging my psql David G. Johnston <[email protected]>
2025-11-21 19:19 ` Re: What is paging my psql Ron Johnson <[email protected]>
1 sibling, 2 replies; 12+ messages in thread
From: David G. Johnston @ 2025-11-21 19:15 UTC (permalink / raw)
To: lejeczek <[email protected]>; +Cc: [email protected] <[email protected]>
On Friday, November 21, 2025, lejeczek <[email protected]> wrote:
>
> I'm only trying to investigate & understand why that is that one box does
> - what I under is "paging" of a short output - whereas other two do _not_
> that.
> The _but_ here is - obviously - that between that 1 box VS 2 other boxes, there
> must be a difference(s) somewhere... but ! where?
>
I guess I’m not trying to walk you through debugging and diagnostics at
this point because this doesn’t seem like a bug. So yes, I’ve have been
unable to completely understand the issue because it is not being presented
in a complete manner. It would be better to pick a single one that is
“wrong”, fully show and describe what you are doing and what you expect to
happen (and ideally why), and basically treat it like a bug report. Asking
us to compare to behaviors that aren’t related to PostgreSQL version is
hit-or-miss. On that note, what is the version or versions of the psql
client involved here?
Since psql is a CLI not mentioning which terminal and/or shells are in use,
or OS, is a major omission here.
David J.
^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: What is paging my psql
2025-11-20 14:16 What is paging my psql lejeczek <[email protected]>
2025-11-20 14:36 ` Re: What is paging my psql David G. Johnston <[email protected]>
2025-11-21 09:40 ` Re: What is paging my psql lejeczek <[email protected]>
2025-11-21 13:34 ` Re: What is paging my psql David G. Johnston <[email protected]>
2025-11-21 17:55 ` Re: What is paging my psql lejeczek <[email protected]>
2025-11-21 19:15 ` Re: What is paging my psql David G. Johnston <[email protected]>
@ 2025-11-21 19:17 ` David G. Johnston <[email protected]>
1 sibling, 0 replies; 12+ messages in thread
From: David G. Johnston @ 2025-11-21 19:17 UTC (permalink / raw)
To: lejeczek <[email protected]>; +Cc: [email protected] <[email protected]>
On Friday, November 21, 2025, David G. Johnston <[email protected]>
wrote:
>
> Since psql is a CLI not mentioning which terminal and/or shells are in
> use, or OS, is a major omission here.
>
Ok, I found the versioning info. My bad.
David J.
^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: What is paging my psql
2025-11-20 14:16 What is paging my psql lejeczek <[email protected]>
2025-11-20 14:36 ` Re: What is paging my psql David G. Johnston <[email protected]>
2025-11-21 09:40 ` Re: What is paging my psql lejeczek <[email protected]>
2025-11-21 13:34 ` Re: What is paging my psql David G. Johnston <[email protected]>
2025-11-21 17:55 ` Re: What is paging my psql lejeczek <[email protected]>
2025-11-21 19:15 ` Re: What is paging my psql David G. Johnston <[email protected]>
@ 2025-11-21 19:19 ` Ron Johnson <[email protected]>
1 sibling, 0 replies; 12+ messages in thread
From: Ron Johnson @ 2025-11-21 19:19 UTC (permalink / raw)
To: [email protected] <[email protected]>
On Fri, Nov 21, 2025 at 2:15 PM David G. Johnston <
[email protected]> wrote:
> On Friday, November 21, 2025, lejeczek <[email protected]> wrote:
>>
>> I'm only trying to investigate & understand why that is that one box does
>> - what I under is "paging" of a short output - whereas other two do _not_
>> that.
>> The _but_ here is - obviously - that between that 1 box VS 2 other
>> boxes, there must be a difference(s) somewhere... but ! where?
>>
>
> I guess I’m not trying to walk you through debugging and diagnostics at
> this point because this doesn’t seem like a bug. So yes, I’ve have been
> unable to completely understand the issue because it is not being presented
> in a complete manner. It would be better to pick a single one that is
> “wrong”, fully show and describe what you are doing and what you expect to
> happen (and ideally why), and basically treat it like a bug report. Asking
> us to compare to behaviors that aren’t related to PostgreSQL version is
> hit-or-miss. On that note, what is the version or versions of the psql
> client involved here?
>
> Since psql is a CLI not mentioning which terminal and/or shells are in
> use, or OS, is a major omission here.
>
http://www.catb.org/~esr/faqs/smart-questions.html used to be the go-to
link, and should be again.
--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!
^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: What is paging my psql
2025-11-20 14:16 What is paging my psql lejeczek <[email protected]>
2025-11-20 14:36 ` Re: What is paging my psql David G. Johnston <[email protected]>
@ 2025-11-21 09:43 ` lejeczek <[email protected]>
1 sibling, 0 replies; 12+ messages in thread
From: lejeczek @ 2025-11-21 09:43 UTC (permalink / raw)
To: ; +Cc: [email protected] <[email protected]>
neither any shell aliases involving psql exist
^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: What is paging my psql
2025-11-20 14:16 What is paging my psql lejeczek <[email protected]>
@ 2025-11-20 19:02 ` Laurenz Albe <[email protected]>
1 sibling, 0 replies; 12+ messages in thread
From: Laurenz Albe @ 2025-11-20 19:02 UTC (permalink / raw)
To: lejeczek <[email protected]>; [email protected]
On Thu, 2025-11-20 at 15:16 +0100, lejeczek wrote:
> I have virtually identical 3 servers and one is paging the output.
>
> Would you know where is it coming from and how to fix it permanently
It is probably on by default.
Set the environment variable PAGER to an empty string.
Yours,
Laurenz Albe
^ permalink raw reply [nested|flat] 12+ messages in thread
end of thread, other threads:[~2025-11-21 19:19 UTC | newest]
Thread overview: 12+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-11-20 14:16 What is paging my psql lejeczek <[email protected]>
2025-11-20 14:36 ` David G. Johnston <[email protected]>
2025-11-21 09:40 ` lejeczek <[email protected]>
2025-11-21 13:34 ` David G. Johnston <[email protected]>
2025-11-21 15:16 ` Tom Lane <[email protected]>
2025-11-21 17:55 ` lejeczek <[email protected]>
2025-11-21 18:55 ` Tom Lane <[email protected]>
2025-11-21 19:15 ` David G. Johnston <[email protected]>
2025-11-21 19:17 ` David G. Johnston <[email protected]>
2025-11-21 19:19 ` Ron Johnson <[email protected]>
2025-11-21 09:43 ` lejeczek <[email protected]>
2025-11-20 19:02 ` Laurenz Albe <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox