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 1vOEsQ-00GO6u-0Z for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Nov 2025 12:44:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vOEsN-00GJrB-28 for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Nov 2025 12:44:03 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vOEsN-00GJr3-0M for pgsql-hackers@lists.postgresql.org; Wed, 26 Nov 2025 12:44:03 +0000 Received: from fout-a6-smtp.messagingengine.com ([103.168.172.149]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vOEsK-001bes-1v for pgsql-hackers@postgresql.org; Wed, 26 Nov 2025 12:44:02 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfout.phl.internal (Postfix) with ESMTP id 1991FEC0388; Wed, 26 Nov 2025 07:43:59 -0500 (EST) Received: from phl-imap-05 ([10.202.2.95]) by phl-compute-06.internal (MEProxy); Wed, 26 Nov 2025 07:43:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eulerto.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:subject:subject:to:to; s=fm1; t=1764161039; x=1764247439; bh=fSSZ5Fo+AFVn45RbfMTDHtA5e5Jif8tJl55h1Hp5NqI=; b= o6zgDXzcw457SALbdRwqIqmNg7GjYMJHilAHK6Is65iIlKlPPzdz8FheaoFjdCqe j5B4Mr8qZ5j7l/WsE8CBKgbx6aFqW/VJjaaCL/iTb/WIjLyAK+sf6uOiMsvaqbxZ rZ4Aw9UGGdBeAUeBH/pVcwALFonk0iKnwXN8+3BMJELuWGpIx3q/b0OChk9dVUkB TQj7ereszhMl/4nzuE4HBe2bLSKCoPOqKBLmZ9pvsf8YxskTg5YBoKLQYr1KR82h 1I1ahsuNilsHdLS0ytMp8djM9EukP9j8CVCIrEm4CcDEHj6KkzcgFA9LMBaCcXuo EZ2R9A3zhhuXs3IrtAvZvw== 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:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1764161039; x=1764247439; bh=f SSZ5Fo+AFVn45RbfMTDHtA5e5Jif8tJl55h1Hp5NqI=; b=MirKCe0+hSw9veyY5 E3d2xKiJ5zcw0p1fH+wdCxFwxqyaFJ57JHiedXbcLCVvu/T4BONDE6v+GAtHmE3w bVJwfi69Zz2qOUimjKTy6Fkk17U5gNC36W9OrBgcbbg6xrW+Rn9eO56z86CAfUXU 7Zu8CCxsSyVPFYRc7im2huCsl8qj1xrbqBu4Pjp38f39fWZ2blpO34WWOrcxRmMG MfxD/KJPKDCL//5HWG8oW0MNDF4HWRZXToDqz34+8KX8Ja3RK6VbmArL9VSgx/JK F0hcOY7s8sU5kZD26E4dgnKGUn51vjwaKvStCucx8bDWFqRoRxC09M7RDhSvWe3x Eq0dA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddvgeegfeekucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucenucfjughrpefoggffhffvkfgjfhfutgfgsehtqhertd ertdejnecuhfhrohhmpedfgfhulhgvrhcuvfgrvhgvihhrrgdfuceovghulhgvrhesvghu lhgvrhhtohdrtghomheqnecuggftrfgrthhtvghrnhepueelleevhfdtheeggeevjeffke ehjeeuleefteevheffjeeljeduvdejffdtheeknecuffhomhgrihhnpehpohhsthhgrhgv shhqlhdrohhrghdpvghnthgvrhhprhhishgvuggsrdgtohhmnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepvghulhgvrhesvghulhgvrhhtohdr tghomhdpnhgspghrtghpthhtohepvddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoh epmhgvhhhmvghtsegrthhifhgtvgihlhgrnhdrtghomhdprhgtphhtthhopehpghhsqhhl qdhhrggtkhgvrhhssehpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i0c21471d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 9FD941820054; Wed, 26 Nov 2025 07:43:58 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 X-ThreadId: AuoeFfyZ_UPo Date: Wed, 26 Nov 2025 09:43:38 -0300 From: "Euler Taveira" To: =?UTF-8?Q?M=2EAt=C4=B1f_Ceylan?= , pgsql-hackers Message-Id: <84647ed5-9302-4c1e-8364-6c575cee20b0@app.fastmail.com> In-Reply-To: References: Subject: Re: [PATCH] psql: add size-based sorting options (O/o) for tables and indexes Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Nov 26, 2025, at 4:48 AM, M.At=C4=B1f Ceylan wrote: > Hello, > This patch adds two new meta-command modifiers for \dt(+) and \di(+): > > - O : sort by total relation size descending > - o : sort by total relation size ascending > Thanks for your contribution. Register your patch in the next commitfest= [1] so we don't loose track of it. I didn't look at your patch but I was wondering if a general solution is= n't a better way to add this feature. I wouldn't modify these specific psql meta-commands, instead, I would add a new psql meta-command that defines= this property for all objects if applicable. \sort [ name | size [ asc | desc ] ] I thought about a list to be cover other sort cases too but if things st= arting to be complex, it is time to write your own query. With a parameter, it appends the ORDER BY clause in the SQL commands exe= cuted by psql if applicable. Without a parameter, it uses the current behavior. [1] https://commitfest.postgresql.org/57/ --=20 Euler Taveira EDB https://www.enterprisedb.com/