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 1q5SpR-0005xP-VO for pgsql-general@arkaria.postgresql.org; Sat, 03 Jun 2023 15:06:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q5SpP-0006LW-Hw for pgsql-general@arkaria.postgresql.org; Sat, 03 Jun 2023 15:06:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q5SpN-0006LL-J6 for pgsql-general@lists.postgresql.org; Sat, 03 Jun 2023 15:06:03 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q5SpF-003RLI-QB for pgsql-general@lists.postgresql.org; Sat, 03 Jun 2023 15:06:00 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 3013B5C0102; Sat, 3 Jun 2023 11:05:52 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sat, 03 Jun 2023 11:05:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1685804752; x=1685891152; bh=iUK9e7TQUz9RjnsrC54LlzQg/dujLlG6DJ1 yoYWvftI=; b=Shp+IN+gmS53GLOHiEqFNyyh99nJdGM8FEPooKQNlXw1+3oDomo QxShW9IluEKStFNId3RW1UbgWNv2czeTi+GmrJ/5WUm7nbNT3ETDPh3S/VwtYcwk fV4crJHUp3oegBeVfheOjWdY1IyvfX9NbASwXQ6WP36NJiVpx2j7UP0IiN27/luN yuWz1XwnSImt0bQ0oWnIif0tl16jPvben4+U40/gs9X2F7QbQTRfrBmA+zaf7EcX KgYWh3qcDjMCJNXUz9F6Kqy0E5o78zyoc4sX9FOKyPaxP5i5RqXcOzhjI9PupySG HV0c+OdU3MMa9XszzaKmGWCd6o/+1jurIOA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1685804752; x= 1685891152; bh=iUK9e7TQUz9RjnsrC54LlzQg/dujLlG6DJ1yoYWvftI=; b=R LzVIsM3n/CMUPhkbY0krGedlbq3hrrgLF0VDpYBUKuiH50cihuDWM50HYiAfgnXh 5av7039jULdeo9StniLaKXwz8QzTLMra7dB8cM35MIz0cbhQUQwcbqY97wVpSRy1 sOWJ6l3fyMI3R2IQWx0A+BrNThupFPF2eRxbRNg7jYQKNvr9ZHS/kiI2yw+AODk2 ljrJ+l1rvsgZvcYTt3RFF5dq6HEmqaDoC3jrP/My7ea5yFllUcVFcA5Z/d212qYp 6jhLbGkSeoYgUKwaBXjTTVZXxJBCRTrpBWl2KIyLVHWBoOU1qVYmaO2GbaMDzy7V tS0Y3EPo5BS4QQlvzaUQQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeelhedgkeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvfhfhjggtgfesthekredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpeelkeegjefhkeetheefudevteehiedvudehkeduleet fedvffeuhedtvdegtdeffeenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhi rghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 3 Jun 2023 11:05:51 -0400 (EDT) Message-ID: Date: Sat, 3 Jun 2023 08:05:50 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Subject: Re: Number of dashes in the expanded view of psql Content-Language: en-US To: Rajiv Harlalka , pgsql-general@lists.postgresql.org References: From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 6/3/23 03:12, Rajiv Harlalka wrote: > Hello, >      While watching results of some internal tables in pg , looked that > the number of dashes between records depends on the char length of the > longest column (referring to dashes here -[ RECORD 1 ]-------------). > Wouldn't it be better to have a better method for number of such dashes > as for tables having arrays or similar datatypes, if the length of entry > is long enough this can fill up entire TERM_HEIGHT. > >   Regards, > Rajiv Harlalka, > From https://www.postgresql.org/docs/current/app-psql.html \pset format ... wrapped format is like aligned but wraps wide data values across lines to make the output fit in the target column width. The target width is determined as described under the columns option. Note that psql will not attempt to wrap column header titles; therefore, wrapped format behaves the same as aligned if the total width needed for column headers exceeds the target. ... columns Sets the target width for the wrapped format, and also the width limit for determining whether output is wide enough to require the pager or switch to the vertical display in expanded auto mode. Zero (the default) causes the target width to be controlled by the environment variable COLUMNS, or the detected screen width if COLUMNS is not set. In addition, if columns is zero then the wrapped format only affects screen output. If columns is nonzero then file and pipe output is wrapped to that width as well. So: create table wide_test(id integer, fld_1 varchar, fld_2 varchar); insert into wide_test values (1, 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'), (2, 'ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', 'dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd'); In below I am not showing output as is it is distorted by email client. You can use the above table and data to see the effect of changing the format. test(5432)=# \pset format aligned Output format is aligned. test(5432)=# select * from wide_test ; test(5432)=# \pset format wrapped Output format is wrapped. test(5432)=# select * from wide_test ; -- Adrian Klaver adrian.klaver@aklaver.com