Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oEtlE-0004So-DV for pgsql-general@arkaria.postgresql.org; Fri, 22 Jul 2022 14:36:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oEtlD-00015L-9W for pgsql-general@arkaria.postgresql.org; Fri, 22 Jul 2022 14:36:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oEtlC-00012n-Vc for pgsql-general@lists.postgresql.org; Fri, 22 Jul 2022 14:36:10 +0000 Received: from mout.perfora.net ([74.208.4.196]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oEtlA-0001mw-59 for pgsql-general@lists.postgresql.org; Fri, 22 Jul 2022 14:36:10 +0000 Received: from [192.168.1.100] ([194.237.255.67]) by mrelay.perfora.net (mreueus004 [74.208.5.2]) with ESMTPSA (Nemesis) id 1MyKcC-1nIWHB0lfo-00yljS for ; Fri, 22 Jul 2022 16:36:05 +0200 Subject: Re: Paging through table one row at a ttime References: <9757a08e-7c32-048b-5584-b1bf09004dff@meddatainc.com> To: pgsql-general@lists.postgresql.org From: H Message-ID: <286756a4-6847-5a0c-88ce-9f05966f6698@meddatainc.com> Date: Fri, 22 Jul 2022 16:33:14 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US X-Provags-ID: V03:K1:+k8Mn906xlU5GtyV4NeUKgD/ugw1QRYslm4twuc6IufkUmOD8Es RX6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archive: Archived-At: Precedence: bulk On 07/22/2022 03:14 PM, Bruce Momjian wrote: > On Fri, Jul 22, 2022 at 07:05:31AM -0600, Rob Sargent wrote: >> >>> On Jul 22, 2022, at 6:31 AM, H wrote: >>> >>> On 07/20/2022 03:09 PM, H wrote: >>>> I am running postgres 13 under CentOS 7. I have a need to be able to page through a table one row at a time, possibly using pspg (or other tool) allowing me to move in either direction in the table one single row at a time. Ideally only the columns in the selected row should be visible, even better if there would be one column of that row per row in the terminal window but that would probably be wishing for too much. >>>> >>>> Is there any configuration of pspg that would allow me to do the above? >>>> >>>> >>>> >>> I have not seen any replies to my question above - is this perhaps not possible to do? >>> >>> >> I didn’t follow the “even better”. Aside from that most of us are simple sql users and data managers - we don’t go back and forth row by row all that often. Have you found the LIMIT and OFFSET features of SELECT statement? After that your in application space and not this forum perhaps > Yeah, I was confused by the question. I originally thought you were > asking about pagination, and I have several blog entries about that: > > https://momjian.us/main/blogs/pgblog/2020.html#August_17_2020 > > but it then sounded like you were looking for a terminal-level API, > which kind of sounded like pspg, which you are using, but something much > more sophisticated. > Let me flesh out my need a little bit more. I have a need for a quick-and-dirty solution to paging through a postgresql table. pspg almost fits that need but could be even better. Using pspg I can either: (1) view one table row in each pspg terminal window row using the pspg flag to shorten columns, or (2) list as much of the table row in the pspg terminal window as fits. Depending on the size of the row, this could mean less than one table row or more than one table row. To make it easier to view individual table rows in eg. pspg I would like to view exactly one table row, not more, and ideally each column of that table row would use individual pspg terminal rows. I hope that makes it clearer. Hoping this might be possible, either using pspg or other similar software. I am not writing any application code.