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.94.2) (envelope-from ) id 1tWGRC-00FNDq-0Q for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Jan 2025 14:56:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tWGRB-00HGpK-Cj for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Jan 2025 14:56:37 +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.94.2) (envelope-from ) id 1tWGRB-00HGpC-26 for pgsql-hackers@lists.postgresql.org; Fri, 10 Jan 2025 14:56:36 +0000 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tWGR8-000tU4-22 for pgsql-hackers@lists.postgresql.org; Fri, 10 Jan 2025 14:56:35 +0000 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-aaee2c5ee6eso358737166b.1 for ; Fri, 10 Jan 2025 06:56:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736520993; x=1737125793; darn=lists.postgresql.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :subject:cc:to:from:date:sender:message-id:from:to:cc:subject:date :message-id:reply-to; bh=MoCU25ooPbDB4yOg9wLOpK61rSD1/VBtx7Rhn+5EzNo=; b=JQskhC/YaQB+u4udLQaIo/b6WOGoZXdjLoT0Ro4iibDpVKsvjmy5bYBlrxayXgXRhe VYcVIQZxZeCxwN4VzWgZLw6rZZv49aZZ7MUUy9leE/68VtDIjuexiLEavUABIWCS/7Je oL3+0wLNbgVNa19yNNpo+zg9uPTWC3cY9j2yaG9UiZDYEAsWhbmy7ifVGbtXnaeldbXM BYnlzGrtbKfyz8NU5Lv3mgDyjmm9vrFglENneybPWiIdtcbwmsT/b8V41CX5sFlYxDet nnYm/WsgJXEfUEz0HkLblk7WKUP5e2aeIoUodwkTs0E4IYdmr1UcPEYnVFAqCMfJM2ke M+pA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736520993; x=1737125793; h=user-agent:in-reply-to:content-disposition:mime-version:references :subject:cc:to:from:date:sender:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=MoCU25ooPbDB4yOg9wLOpK61rSD1/VBtx7Rhn+5EzNo=; b=TR2tkoyyJdnU1sNbughQiO2ytsdeVYHNRv0WdhelDqVftV230wQLt/f+qqqfGSNO15 /5SxPBlz1cAuhZOhCkgv3vmqzXvlumL0+qMZ6V8lLhbrrAd4IPBEgTXAr0nZ98yCiAs2 /Xp+CqnA0uNSFyR4pdWTxuJwTApYPQ7M+5YGqoJkfGEFrS10gXuX2lqnUbNYpebCkUuG VL4ZqwKxda9Ni24oBe8dFTVG4C1gUe3YGI8JuNeNb9b2BgFyGpeIvRHhR3twDfml5F/J YpI54YCaI/mWY2y8RkFeoI66Y/KldRTvZH2q2IcmvHdQkhgtiyfb92CgnwBjD3G8cvY0 Qd4A== X-Gm-Message-State: AOJu0Yxyo0t8S7d+zVcSDunjUzgDKt/zz3/IndeVe3CvRmqYF9jf3PR+ n5i6TlujOs12tPeA/dTfanq2SaZJiolM/RpVHBzBLGR3eVfx36Q0 X-Gm-Gg: ASbGncuRmoIh+vqqAeqHr7MMNX+KpufBAs7+kD9PLA/Hknx6dNtrobX/UU2wxJo5O3G kVBIHeAwG0eQP3YLkPsWT/JibncKhlp8vPK3WY3HJdFRriCbFkgCZIQS1AOMk3WWvSoTjq+wjDG CHluPxMVif2Qa2Wcy9tLYhNbrhT96O7drRcPxcW1/DTlkyoWVoHjFctfuXyKJo6RMJCcER90m9h qgnHOvj4CjiCXAniZxRJ2zKC88joDDNwEsC50p6YrpTdGqG09pAYf08RKVR9oMyrYV1MX+3jhws D5ENAy4WS9sZH6I= X-Google-Smtp-Source: AGHT+IGnPwCZ8FWHSsFRDMccmDpAG/WokRBSoKg3OjEyPyb+tWjRp0FcwCPhKUyXuVu7JKnXl4FTAQ== X-Received: by 2002:a17:906:6a19:b0:a9e:d4a9:2c28 with SMTP id a640c23a62f3a-ab2abc920abmr1118182266b.53.1736520992541; Fri, 10 Jan 2025 06:56:32 -0800 (PST) Received: from lightning.caipicrew.dd-dns.de ([2001:a61:a06:e901:7b09:1f30:4e0b:b7a6]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c9563c10sm175680266b.92.2025.01.10.06.56.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jan 2025 06:56:32 -0800 (PST) Message-ID: <67813520.170a0220.183245.7bf0@mx.google.com> X-Google-Original-Message-ID: <20250110145631.GA16813@caipicrew.dd-dns.de;lightning.caipicrew.dd-dns.de> Sender: Michael Banck Received: from mbanck by lightning.caipicrew.dd-dns.de with local (Exim 4.92) (envelope-from ) id 1tWGR5-0006a5-GM; Fri, 10 Jan 2025 15:56:31 +0100 Date: Fri, 10 Jan 2025 15:56:31 +0100 From: Michael Banck To: Magnus Hagander Cc: PostgreSQL Developers Subject: Re: Adding extension default version to \dx References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Fri, Jan 10, 2025 at 01:04:14PM +0100, Magnus Hagander wrote: > In an effort to make at least a couple of more people realize they have to > run ALTER EXTENSION UPDATE after they've upgraded an extension, as well as > make it a bit easier to realize when you have to do it, I propose we add > the default version of an extension to \dx in psql +1, I think this is useful. > diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c > index d5543fd62b0..319ad15d4de 100644 > --- a/src/bin/psql/describe.c > +++ b/src/bin/psql/describe.c > @@ -6107,13 +6107,16 @@ listExtensions(const char *pattern) > initPQExpBuffer(&buf); > printfPQExpBuffer(&buf, > "SELECT e.extname AS \"%s\", " > - "e.extversion AS \"%s\", n.nspname AS \"%s\", c.description AS \"%s\"\n" > + "e.extversion AS \"%s\", ae.default_version AS \"%s\"," > + "n.nspname AS \"%s\", c.description AS \"%s\"\n" > "FROM pg_catalog.pg_extension e " > "LEFT JOIN pg_catalog.pg_namespace n ON n.oid = e.extnamespace " > "LEFT JOIN pg_catalog.pg_description c ON c.objoid = e.oid " Not really part of your patch, but "pg_catalog.pg_description c" looks weird/might be a typo? It is "pg_catalog.pg_description d" everywhere else AFAICT. So maybe this could be fixed/changed in passing? > + "LEFT JOIN pg_catalog.pg_available_extensions() ae(name, default_version, comment) ON ae.name=e.extname " > "AND c.classoid = 'pg_catalog.pg_extension'::pg_catalog.regclass\n", > gettext_noop("Name"), > gettext_noop("Version"), > + gettext_noop("Default version"), pg_available_extensions has "installed_version" and "default_version", I wonder whether it would make sense to harmonize that and change "Version" to "Installed version" as well when we change the output anyway? Michael