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;








29















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.










share|improve this question






















  • 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

















29















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.










share|improve this question






















  • 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













29












29








29


7






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.










share|improve this question














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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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'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
















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










4 Answers
4






active

oldest

votes


















31














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.






share|improve this answer


















  • 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 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





    @MichaelRush: Set PAGER to less -X and it won't clear the screen.

    – Sven
    Apr 4 '14 at 16:40


















15














Try switcher:



database_name=# pset pager
Pager is used for long output.
database_name=# pset pager
Pager usage is off.





share|improve this answer




















  • 1





    Also pset pager [on|off] for constant result.

    – lolesque
    Jul 16 '15 at 16:27


















3














Switch the pager off with



pset pager off





share|improve this answer

























  • This simply the accepted answer for me. Thank you.

    – Nam G VU
    Jul 11 '18 at 7:52


















1














add below code in ~/.psqlrc to retain the behaviour



pset pager off






share|improve this answer























    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
    );



    );













    draft saved

    draft discarded


















    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









    31














    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.






    share|improve this answer


















    • 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 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





      @MichaelRush: Set PAGER to less -X and it won't clear the screen.

      – Sven
      Apr 4 '14 at 16:40















    31














    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.






    share|improve this answer


















    • 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 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





      @MichaelRush: Set PAGER to less -X and it won't clear the screen.

      – Sven
      Apr 4 '14 at 16:40













    31












    31








    31







    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.






    share|improve this answer













    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.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Feb 14 '11 at 9:34









    SvenSven

    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 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





      @MichaelRush: Set PAGER to less -X and it won't clear the screen.

      – Sven
      Apr 4 '14 at 16:40












    • 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 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





      @MichaelRush: Set PAGER to less -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













    15














    Try switcher:



    database_name=# pset pager
    Pager is used for long output.
    database_name=# pset pager
    Pager usage is off.





    share|improve this answer




















    • 1





      Also pset pager [on|off] for constant result.

      – lolesque
      Jul 16 '15 at 16:27















    15














    Try switcher:



    database_name=# pset pager
    Pager is used for long output.
    database_name=# pset pager
    Pager usage is off.





    share|improve this answer




















    • 1





      Also pset pager [on|off] for constant result.

      – lolesque
      Jul 16 '15 at 16:27













    15












    15








    15







    Try switcher:



    database_name=# pset pager
    Pager is used for long output.
    database_name=# pset pager
    Pager usage is off.





    share|improve this answer















    Try switcher:



    database_name=# pset pager
    Pager is used for long output.
    database_name=# pset pager
    Pager usage is off.






    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Dec 9 '14 at 15:48









    masegaloeh

    16.5k74488




    16.5k74488










    answered Dec 9 '14 at 15:38









    LebnikLebnik

    15112




    15112







    • 1





      Also pset pager [on|off] for constant result.

      – lolesque
      Jul 16 '15 at 16:27












    • 1





      Also pset 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











    3














    Switch the pager off with



    pset pager off





    share|improve this answer

























    • This simply the accepted answer for me. Thank you.

      – Nam G VU
      Jul 11 '18 at 7:52















    3














    Switch the pager off with



    pset pager off





    share|improve this answer

























    • This simply the accepted answer for me. Thank you.

      – Nam G VU
      Jul 11 '18 at 7:52













    3












    3








    3







    Switch the pager off with



    pset pager off





    share|improve this answer















    Switch the pager off with



    pset pager off






    share|improve this answer














    share|improve this answer



    share|improve this answer








    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

















    • 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











    1














    add below code in ~/.psqlrc to retain the behaviour



    pset pager off






    share|improve this answer



























      1














      add below code in ~/.psqlrc to retain the behaviour



      pset pager off






      share|improve this answer

























        1












        1








        1







        add below code in ~/.psqlrc to retain the behaviour



        pset pager off






        share|improve this answer













        add below code in ~/.psqlrc to retain the behaviour



        pset pager off







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered May 17 at 21:38









        Vivin VeeraliVivin Veerali

        111




        111



























            draft saved

            draft discarded
















































            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.




            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            Wikipedia:Vital articles Мазмуну Biography - Өмүр баян Philosophy and psychology - Философия жана психология Religion - Дин Social sciences - Коомдук илимдер Language and literature - Тил жана адабият Science - Илим Technology - Технология Arts and recreation - Искусство жана эс алуу History and geography - Тарых жана география Навигация менюсу

            Bruxelas-Capital Índice Historia | Composición | Situación lingüística | Clima | Cidades irmandadas | Notas | Véxase tamén | Menú de navegacióneO uso das linguas en Bruxelas e a situación do neerlandés"Rexión de Bruxelas Capital"o orixinalSitio da rexiónPáxina de Bruselas no sitio da Oficina de Promoción Turística de Valonia e BruxelasMapa Interactivo da Rexión de Bruxelas-CapitaleeWorldCat332144929079854441105155190212ID28008674080552-90000 0001 0666 3698n94104302ID540940339365017018237

            What should I write in an apology letter, since I have decided not to join a company after accepting an offer letterShould I keep looking after accepting a job offer?What should I do when I've been verbally told I would get an offer letter, but still haven't gotten one after 4 weeks?Do I accept an offer from a company that I am not likely to join?New job hasn't confirmed starting date and I want to give current employer as much notice as possibleHow should I address my manager in my resignation letter?HR delayed background verification, now jobless as resignedNo email communication after accepting a formal written offer. How should I phrase the call?What should I do if after receiving a verbal offer letter I am informed that my written job offer is put on hold due to some internal issues?Should I inform the current employer that I am about to resign within 1-2 weeks since I have signed the offer letter and waiting for visa?What company will do, if I send their offer letter to another company