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 1oEsUO-0001Fj-R5 for pgsql-general@arkaria.postgresql.org; Fri, 22 Jul 2022 13:14:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oEsUN-0004nC-LF for pgsql-general@arkaria.postgresql.org; Fri, 22 Jul 2022 13:14:43 +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 1oEsUN-0004n3-AW for pgsql-general@lists.postgresql.org; Fri, 22 Jul 2022 13:14:43 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oEsUK-00012M-RU for pgsql-general@lists.postgresql.org; Fri, 22 Jul 2022 13:14:42 +0000 Received: from bruce by momjian.us with local (Exim 4.94.2) (envelope-from ) id 1oEsUI-008e8b-2x; Fri, 22 Jul 2022 09:14:38 -0400 Date: Fri, 22 Jul 2022 09:14:38 -0400 From: Bruce Momjian To: Rob Sargent Cc: H , pgsql-general@lists.postgresql.org Subject: Re: Paging through table one row at a ttime Message-ID: References: <9757a08e-7c32-048b-5584-b1bf09004dff@meddatainc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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. -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com Indecision is a decision. Inaction is an action. Mark Batterson