Turn off pager for psql's interactive outputssh connection interrupted while interactive psql running command--will command finish? Can I reconnect?psql asks for password despite configuring trust authentication from localhostpg_dump: [archiver (db)] connection to database failed: FATAL: Peer authentication failed for user “postgres”`psql` expanded mode equivalency for `mysql`psql: How to include comments in d outputWhy doesn't “psql -U” work for me?
GFCI Outlet in Bathroom, Lights not working
How to split a string in two substrings of same length using bash?
Does Peach's float negate shorthop knockback multipliers?
Is the decompression of compressed and encrypted data without decryption also theoretically impossible?
Is it possible for people to live in the eye of a permanent hypercane?
Is there a practical difference between different types of Berachos?
Movie where a boy is transported into the future by an alien spaceship
Could the Missouri River be running while Lake Michigan was frozen several meters deep?
How can I add depth to my story or how do I determine if my story already has depth?
Computing the differentials in the Adams spectral sequence
Is it OK to bring delicacies from hometown as tokens of gratitude for an out-of-town interview?
Why was it possible to cause an Apple //e to shut down with SHIFT and paddle button 2?
Is it a problem that pull requests are approved without any comments
What happens if you do emergency landing on a US base in middle of the ocean?
Incremental Ranges!
Why were the Night's Watch required to be celibate?
Humans meet a distant alien species. How do they standardize? - Units of Measure
Can an old DSLR be upgraded to match modern smartphone image quality
Does any lore text explain why the planes of Acheron, Gehenna, and Carceri are the alignment they are?
How can a single Member of the House block a Congressional bill?
pitch and volume compensations for different instruments
Get value of the passed argument to script importing variables from another script
When leasing/renting out an owned property, is there a standard ratio between monthly rent and the mortgage?
What happens to foam insulation board after you pour concrete slab?
Turn off pager for psql's interactive output
ssh connection interrupted while interactive psql running command--will command finish? Can I reconnect?psql asks for password despite configuring trust authentication from localhostpg_dump: [archiver (db)] connection to database failed: FATAL: Peer authentication failed for user “postgres”`psql` expanded mode equivalency for `mysql`psql: How to include comments in d outputWhy doesn't “psql -U” work for me?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
We switched from PostgreSQL 8.3 to 9.0. Perhaps it's a new feature or perhaps just a configuration change, but now when output from commands (like, d tablename
) exceeds visible vertical space, psql seem to pipe the output through something similar to less
. I could not find a way to turn this behaviour off. Any advice? Thanks.
P.S. I'm scrolling the buffer using PuTTY's Shift+PgUp/PgDn
so I don't need psql's paging. Plus, when I press q
in the psql's paging, its output disappears from the screen entirely (just like after running less
in bash), which is wrong from the general use-cases point of view.
psql
add a comment |
We switched from PostgreSQL 8.3 to 9.0. Perhaps it's a new feature or perhaps just a configuration change, but now when output from commands (like, d tablename
) exceeds visible vertical space, psql seem to pipe the output through something similar to less
. I could not find a way to turn this behaviour off. Any advice? Thanks.
P.S. I'm scrolling the buffer using PuTTY's Shift+PgUp/PgDn
so I don't need psql's paging. Plus, when I press q
in the psql's paging, its output disappears from the screen entirely (just like after running less
in bash), which is wrong from the general use-cases point of view.
psql
If you're here from Google just trying to scroll through the pager, it'sSpace
-- not n or PgDn or down arrow like I tried.
– Noumenon
Dec 29 '16 at 15:51
add a comment |
We switched from PostgreSQL 8.3 to 9.0. Perhaps it's a new feature or perhaps just a configuration change, but now when output from commands (like, d tablename
) exceeds visible vertical space, psql seem to pipe the output through something similar to less
. I could not find a way to turn this behaviour off. Any advice? Thanks.
P.S. I'm scrolling the buffer using PuTTY's Shift+PgUp/PgDn
so I don't need psql's paging. Plus, when I press q
in the psql's paging, its output disappears from the screen entirely (just like after running less
in bash), which is wrong from the general use-cases point of view.
psql
We switched from PostgreSQL 8.3 to 9.0. Perhaps it's a new feature or perhaps just a configuration change, but now when output from commands (like, d tablename
) exceeds visible vertical space, psql seem to pipe the output through something similar to less
. I could not find a way to turn this behaviour off. Any advice? Thanks.
P.S. I'm scrolling the buffer using PuTTY's Shift+PgUp/PgDn
so I don't need psql's paging. Plus, when I press q
in the psql's paging, its output disappears from the screen entirely (just like after running less
in bash), which is wrong from the general use-cases point of view.
psql
psql
asked Feb 14 '11 at 9:18
Yuri UshakovYuri Ushakov
253148
253148
If you're here from Google just trying to scroll through the pager, it'sSpace
-- not n or PgDn or down arrow like I tried.
– Noumenon
Dec 29 '16 at 15:51
add a comment |
If you're here from Google just trying to scroll through the pager, it'sSpace
-- not n or PgDn or down arrow like I tried.
– Noumenon
Dec 29 '16 at 15:51
If you're here from Google just trying to scroll through the pager, it's
Space
-- not n or PgDn or down arrow like I tried.– Noumenon
Dec 29 '16 at 15:51
If you're here from Google just trying to scroll through the pager, it's
Space
-- not n or PgDn or down arrow like I tried.– Noumenon
Dec 29 '16 at 15:51
add a comment |
4 Answers
4
active
oldest
votes
There is documentation for that.
From the pset section of the psql manual:
pager
Controls use of a pager program for query and psql help output. If the environment variable PAGER is set, the output is piped to the specified program. Otherwise a platform-dependent default (such as more) is used.
When the pager option is off, the pager program is not used. When the pager option is on, the pager is used when appropriate, i.e., when the output is to a terminal and will not fit on the screen. The pager option can also be set to always, which causes the pager to be used for all terminal output regardless of whether it fits on the screen. pset pager without a value toggles pager use on and off.
9
Thank you. The complete solution looks like:psql -P pager
.
– Yuri Ushakov
Feb 14 '11 at 9:50
2
I guess you can even put an option in your ~/.psqlrc file to avoid having to enter this every time.
– Sven♦
Feb 14 '11 at 9:52
Anyway to pass arguments to less?
– snapfractalpop
Nov 7 '12 at 21:17
3
I also ran into Yuri's problem. As described above. You can usepset pager
in psql to toggle whether the output goes to the pager. However, you should be able to use a pager and not have the output disappear from the screen when you quit. The answer is to use 'more' instead of 'less' as the pager. You can either do that by setting the PAGER environment variable in your shell or by adding a PAGER environment variable to a ~/.psqlrc file.
– Michael Rush
Apr 4 '14 at 16:29
4
@MichaelRush: SetPAGER
toless -X
and it won't clear the screen.
– Sven♦
Apr 4 '14 at 16:40
|
show 2 more comments
Try switcher:
database_name=# pset pager
Pager is used for long output.
database_name=# pset pager
Pager usage is off.
1
Alsopset pager [on|off]
for constant result.
– lolesque
Jul 16 '15 at 16:27
add a comment |
Switch the pager off with
pset pager off
This simply the accepted answer for me. Thank you.
– Nam G VU
Jul 11 '18 at 7:52
add a comment |
add below code in ~/.psqlrc to retain the behaviour
pset pager off
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f235184%2fturn-off-pager-for-psqls-interactive-output%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
There is documentation for that.
From the pset section of the psql manual:
pager
Controls use of a pager program for query and psql help output. If the environment variable PAGER is set, the output is piped to the specified program. Otherwise a platform-dependent default (such as more) is used.
When the pager option is off, the pager program is not used. When the pager option is on, the pager is used when appropriate, i.e., when the output is to a terminal and will not fit on the screen. The pager option can also be set to always, which causes the pager to be used for all terminal output regardless of whether it fits on the screen. pset pager without a value toggles pager use on and off.
9
Thank you. The complete solution looks like:psql -P pager
.
– Yuri Ushakov
Feb 14 '11 at 9:50
2
I guess you can even put an option in your ~/.psqlrc file to avoid having to enter this every time.
– Sven♦
Feb 14 '11 at 9:52
Anyway to pass arguments to less?
– snapfractalpop
Nov 7 '12 at 21:17
3
I also ran into Yuri's problem. As described above. You can usepset pager
in psql to toggle whether the output goes to the pager. However, you should be able to use a pager and not have the output disappear from the screen when you quit. The answer is to use 'more' instead of 'less' as the pager. You can either do that by setting the PAGER environment variable in your shell or by adding a PAGER environment variable to a ~/.psqlrc file.
– Michael Rush
Apr 4 '14 at 16:29
4
@MichaelRush: SetPAGER
toless -X
and it won't clear the screen.
– Sven♦
Apr 4 '14 at 16:40
|
show 2 more comments
There is documentation for that.
From the pset section of the psql manual:
pager
Controls use of a pager program for query and psql help output. If the environment variable PAGER is set, the output is piped to the specified program. Otherwise a platform-dependent default (such as more) is used.
When the pager option is off, the pager program is not used. When the pager option is on, the pager is used when appropriate, i.e., when the output is to a terminal and will not fit on the screen. The pager option can also be set to always, which causes the pager to be used for all terminal output regardless of whether it fits on the screen. pset pager without a value toggles pager use on and off.
9
Thank you. The complete solution looks like:psql -P pager
.
– Yuri Ushakov
Feb 14 '11 at 9:50
2
I guess you can even put an option in your ~/.psqlrc file to avoid having to enter this every time.
– Sven♦
Feb 14 '11 at 9:52
Anyway to pass arguments to less?
– snapfractalpop
Nov 7 '12 at 21:17
3
I also ran into Yuri's problem. As described above. You can usepset pager
in psql to toggle whether the output goes to the pager. However, you should be able to use a pager and not have the output disappear from the screen when you quit. The answer is to use 'more' instead of 'less' as the pager. You can either do that by setting the PAGER environment variable in your shell or by adding a PAGER environment variable to a ~/.psqlrc file.
– Michael Rush
Apr 4 '14 at 16:29
4
@MichaelRush: SetPAGER
toless -X
and it won't clear the screen.
– Sven♦
Apr 4 '14 at 16:40
|
show 2 more comments
There is documentation for that.
From the pset section of the psql manual:
pager
Controls use of a pager program for query and psql help output. If the environment variable PAGER is set, the output is piped to the specified program. Otherwise a platform-dependent default (such as more) is used.
When the pager option is off, the pager program is not used. When the pager option is on, the pager is used when appropriate, i.e., when the output is to a terminal and will not fit on the screen. The pager option can also be set to always, which causes the pager to be used for all terminal output regardless of whether it fits on the screen. pset pager without a value toggles pager use on and off.
There is documentation for that.
From the pset section of the psql manual:
pager
Controls use of a pager program for query and psql help output. If the environment variable PAGER is set, the output is piped to the specified program. Otherwise a platform-dependent default (such as more) is used.
When the pager option is off, the pager program is not used. When the pager option is on, the pager is used when appropriate, i.e., when the output is to a terminal and will not fit on the screen. The pager option can also be set to always, which causes the pager to be used for all terminal output regardless of whether it fits on the screen. pset pager without a value toggles pager use on and off.
answered Feb 14 '11 at 9:34
Sven♦Sven
88.4k10150202
88.4k10150202
9
Thank you. The complete solution looks like:psql -P pager
.
– Yuri Ushakov
Feb 14 '11 at 9:50
2
I guess you can even put an option in your ~/.psqlrc file to avoid having to enter this every time.
– Sven♦
Feb 14 '11 at 9:52
Anyway to pass arguments to less?
– snapfractalpop
Nov 7 '12 at 21:17
3
I also ran into Yuri's problem. As described above. You can usepset pager
in psql to toggle whether the output goes to the pager. However, you should be able to use a pager and not have the output disappear from the screen when you quit. The answer is to use 'more' instead of 'less' as the pager. You can either do that by setting the PAGER environment variable in your shell or by adding a PAGER environment variable to a ~/.psqlrc file.
– Michael Rush
Apr 4 '14 at 16:29
4
@MichaelRush: SetPAGER
toless -X
and it won't clear the screen.
– Sven♦
Apr 4 '14 at 16:40
|
show 2 more comments
9
Thank you. The complete solution looks like:psql -P pager
.
– Yuri Ushakov
Feb 14 '11 at 9:50
2
I guess you can even put an option in your ~/.psqlrc file to avoid having to enter this every time.
– Sven♦
Feb 14 '11 at 9:52
Anyway to pass arguments to less?
– snapfractalpop
Nov 7 '12 at 21:17
3
I also ran into Yuri's problem. As described above. You can usepset pager
in psql to toggle whether the output goes to the pager. However, you should be able to use a pager and not have the output disappear from the screen when you quit. The answer is to use 'more' instead of 'less' as the pager. You can either do that by setting the PAGER environment variable in your shell or by adding a PAGER environment variable to a ~/.psqlrc file.
– Michael Rush
Apr 4 '14 at 16:29
4
@MichaelRush: SetPAGER
toless -X
and it won't clear the screen.
– Sven♦
Apr 4 '14 at 16:40
9
9
Thank you. The complete solution looks like:
psql -P pager
.– Yuri Ushakov
Feb 14 '11 at 9:50
Thank you. The complete solution looks like:
psql -P pager
.– Yuri Ushakov
Feb 14 '11 at 9:50
2
2
I guess you can even put an option in your ~/.psqlrc file to avoid having to enter this every time.
– Sven♦
Feb 14 '11 at 9:52
I guess you can even put an option in your ~/.psqlrc file to avoid having to enter this every time.
– Sven♦
Feb 14 '11 at 9:52
Anyway to pass arguments to less?
– snapfractalpop
Nov 7 '12 at 21:17
Anyway to pass arguments to less?
– snapfractalpop
Nov 7 '12 at 21:17
3
3
I also ran into Yuri's problem. As described above. You can use
pset pager
in psql to toggle whether the output goes to the pager. However, you should be able to use a pager and not have the output disappear from the screen when you quit. The answer is to use 'more' instead of 'less' as the pager. You can either do that by setting the PAGER environment variable in your shell or by adding a PAGER environment variable to a ~/.psqlrc file.– Michael Rush
Apr 4 '14 at 16:29
I also ran into Yuri's problem. As described above. You can use
pset pager
in psql to toggle whether the output goes to the pager. However, you should be able to use a pager and not have the output disappear from the screen when you quit. The answer is to use 'more' instead of 'less' as the pager. You can either do that by setting the PAGER environment variable in your shell or by adding a PAGER environment variable to a ~/.psqlrc file.– Michael Rush
Apr 4 '14 at 16:29
4
4
@MichaelRush: Set
PAGER
to less -X
and it won't clear the screen.– Sven♦
Apr 4 '14 at 16:40
@MichaelRush: Set
PAGER
to less -X
and it won't clear the screen.– Sven♦
Apr 4 '14 at 16:40
|
show 2 more comments
Try switcher:
database_name=# pset pager
Pager is used for long output.
database_name=# pset pager
Pager usage is off.
1
Alsopset pager [on|off]
for constant result.
– lolesque
Jul 16 '15 at 16:27
add a comment |
Try switcher:
database_name=# pset pager
Pager is used for long output.
database_name=# pset pager
Pager usage is off.
1
Alsopset pager [on|off]
for constant result.
– lolesque
Jul 16 '15 at 16:27
add a comment |
Try switcher:
database_name=# pset pager
Pager is used for long output.
database_name=# pset pager
Pager usage is off.
Try switcher:
database_name=# pset pager
Pager is used for long output.
database_name=# pset pager
Pager usage is off.
edited Dec 9 '14 at 15:48
masegaloeh
16.5k74488
16.5k74488
answered Dec 9 '14 at 15:38
LebnikLebnik
15112
15112
1
Alsopset pager [on|off]
for constant result.
– lolesque
Jul 16 '15 at 16:27
add a comment |
1
Alsopset pager [on|off]
for constant result.
– lolesque
Jul 16 '15 at 16:27
1
1
Also
pset pager [on|off]
for constant result.– lolesque
Jul 16 '15 at 16:27
Also
pset pager [on|off]
for constant result.– lolesque
Jul 16 '15 at 16:27
add a comment |
Switch the pager off with
pset pager off
This simply the accepted answer for me. Thank you.
– Nam G VU
Jul 11 '18 at 7:52
add a comment |
Switch the pager off with
pset pager off
This simply the accepted answer for me. Thank you.
– Nam G VU
Jul 11 '18 at 7:52
add a comment |
Switch the pager off with
pset pager off
Switch the pager off with
pset pager off
edited Jun 21 '18 at 13:04
answered Jun 21 '18 at 12:12
David JonesDavid Jones
1314
1314
This simply the accepted answer for me. Thank you.
– Nam G VU
Jul 11 '18 at 7:52
add a comment |
This simply the accepted answer for me. Thank you.
– Nam G VU
Jul 11 '18 at 7:52
This simply the accepted answer for me. Thank you.
– Nam G VU
Jul 11 '18 at 7:52
This simply the accepted answer for me. Thank you.
– Nam G VU
Jul 11 '18 at 7:52
add a comment |
add below code in ~/.psqlrc to retain the behaviour
pset pager off
add a comment |
add below code in ~/.psqlrc to retain the behaviour
pset pager off
add a comment |
add below code in ~/.psqlrc to retain the behaviour
pset pager off
add below code in ~/.psqlrc to retain the behaviour
pset pager off
answered May 17 at 21:38
Vivin VeeraliVivin Veerali
111
111
add a comment |
add a comment |
Thanks for contributing an answer to Server Fault!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f235184%2fturn-off-pager-for-psqls-interactive-output%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
If you're here from Google just trying to scroll through the pager, it's
Space
-- not n or PgDn or down arrow like I tried.– Noumenon
Dec 29 '16 at 15:51