Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w4v0c-002gwM-2s for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Mar 2026 06:12:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w4v0b-004Xmo-1J for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Mar 2026 06:12:57 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w4v0b-004Xmf-0R for pgsql-hackers@lists.postgresql.org; Tue, 24 Mar 2026 06:12:57 +0000 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w4v0Z-00000000kBI-07tl for pgsql-hackers@lists.postgresql.org; Tue, 24 Mar 2026 06:12:56 +0000 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-82a3d3235c9so826164b3a.2 for ; Mon, 23 Mar 2026 23:12:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774332774; x=1774937574; darn=lists.postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Eq9XhW+Ipo5n8JR1pi4Voi+Pzo9ip6M8WLh5+cW3vPc=; b=bMZ5H6bCifuwSEhUXIhJVsLj8SG0NdLKVRURODk0d+1UzWVZaLW6AwRgafklCUopX1 29rit38FLnK62tfw5OjnbHpylB0U2bEzIwkFeT26bqn7VOWgg81aDIHHIhO8hIAGWoiv TBzC7ee50dsAxVehoJ3T9zMu1ko69GsgebEUaUBlPQoR/7EgZQHLHtnxvE/q5X+e5eXG go1IycLNEniHwOHjZQwBKqS/Yx0SOLmBkln1K/8eDwUpyRLM81QV62ZU4EITFHU6Afrm FNhFcWMoWU01/VOcKJKAV4uYLBr4cLQiUHHXIx5Xn0HmDk1qC2rHPMLuAzYkmWHawoQW ej5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774332774; x=1774937574; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Eq9XhW+Ipo5n8JR1pi4Voi+Pzo9ip6M8WLh5+cW3vPc=; b=sSMsaKA9KKqLoJbdYRSCOkDA7dO/C6gXmXt5ghbosLts1V6l3oHDeCQ1YY02QiRas0 n4Ph2RAEcfYWVzjxRoJWdWeT0yqjtMVYUPHaqFYPHUDVLQ4kTw81ZByXquZU5vWOLaCU YIP2QsoJJR1dEApREk35P62OeXfaPUyac4Uc5pQSpQhOcwnyrHIznfIVekg4zYLcW20a lQiVUjAXsywFkJ6UjgBoej3CgPQmSTh03rgoowL2ngYYIBVPKd1YwqYEAdlUiSR80H+N xKemMkMDQZCcBBfcctFrFtB+lK1jTwXrt2KV8hqOy5Jj/WsWdx4Or7cQySNNWmSUc26l HeYw== X-Gm-Message-State: AOJu0YyCihYyxTD3y175qi1RCB8MEFUg9IfiCplZcDWJE3BiEpLJ5fxR ZbHn2OYCegodW8GivIcGNOF402X7QOGFF+Aow7MZiwj7Hf+3kZiPUnwZQNl6rcSkKiEf0g== X-Gm-Gg: ATEYQzyhbovLMdoOEh+VQDALGZM/tpB7yqlBarsMeYxlLIWEefOXxlVkHV4ZvOuzCXM alu4etbrUgfWE5nwqVDytJSoL6LwgvNQoZ8XhQbK3MoCIbSFZgHssihHwR0+WXIydB0C9Tlyz5n jRHK3Sw7yjXbaI6wl/LL4umJY9C+pTPGHCG7MvKHqhfIe0hDUiZfh3nlNqE8PG7kNxLy8HOTvpR 6nStNe/nXcUCqLhfFQGn/JqozmLfa1Se9z6hbQNUbGPbzNLS7k8cCMjNWMLoUC4LVJnbEvkDoxz 9gmF9XVlzPVLYpPk6VbveMzwnFPQ+30vE2OV3W+SFiVN9T2oOhdPB+5xo7Pr40wQPriJYN1qLmC KfEIvqEiVWWqNuz0vKWf0Me5LDTLhjgnDPcDkZBBVdM1L4Qv1TwEFDX0+WMRrK80reOAmg6lBDv 1ivbpI62fQRDvtYWLJpjyKVdt+3Tkej6g= X-Received: by 2002:a05:6a00:4b13:b0:82c:252e:1700 with SMTP id d2e1a72fcca58-82c252e17e3mr10662948b3a.1.1774332773986; Mon, 23 Mar 2026 23:12:53 -0700 (PDT) Received: from smtpclient.apple ([103.62.49.186]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-82b040db797sm11298119b3a.46.2026.03.23.23.12.52 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Mar 2026 23:12:53 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.400.21\)) Subject: Re: bugfix - fix broken output in expanded aligned format, when data are too short From: Chao Li In-Reply-To: Date: Tue, 24 Mar 2026 14:12:18 +0800 Cc: PostgreSQL Hackers Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Pavel Stehule X-Mailer: Apple Mail (2.3864.400.21) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Mar 24, 2026, at 13:46, Pavel Stehule = wrote: >=20 > Hi >=20 > new version >=20 > * fixed unwanted forcing to wrapped mode > * regress test >=20 > Regards >=20 > Pavel > = Thanks for the fix. The patch overall looks good to me. A couple of = small comments: 1 ``` /* * Calculate available width for data in wrapped mode */ - if (cont->opt->format =3D=3D PRINT_WRAPPED) + if (cont->opt->format =3D=3D PRINT_WRAPPED || cont->opt->format = =3D=3D PRINT_ALIGNED) ``` Since the condition has been updated, I think the comment above should = be adjusted as well. 2 ``` +-- the output in expanded mode is shorter than header +\pset border 2 +\pset expanded on +create table psql_short_tab(a int, b int); +insert into psql_short_tab values(10,20),(30,40); +\pset format aligned +select * from psql_short_tab; +\pset format wrapped +select * from psql_short_tab; +drop table psql_short_tab; + ``` After this test, does it make sense to turn expanded mode off = explicitly, in case it affects following tests? Today the next test = happens to reset it, but maybe tomorrow a new test gets added before = that point. Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/