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 1tcUxg-000WNb-F9 for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Jan 2025 19:39:56 +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 1tcUxd-00EDUc-P1 for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Jan 2025 19:39:53 +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.94.2) (envelope-from ) id 1tcUxd-00EDUU-DH for pgsql-hackers@lists.postgresql.org; Mon, 27 Jan 2025 19:39:53 +0000 Received: from mail-io1-xd34.google.com ([2607:f8b0:4864:20::d34]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tcUxa-001pvR-1Z for pgsql-hackers@lists.postgresql.org; Mon, 27 Jan 2025 19:39:53 +0000 Received: by mail-io1-xd34.google.com with SMTP id ca18e2360f4ac-844dfe4b136so113268039f.3 for ; Mon, 27 Jan 2025 11:39:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738006789; x=1738611589; darn=lists.postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=lXTJWVb5SeeNGKohlzscm8YBrmNhYNSXCZvoZhWgjlU=; b=I9Qtg+inzLyzwUJh8bH89/sCCzIM18TVLsKHMC6p/7j3ptOK1d6QoEVvXnR70yUNZR cETPSu0f0yt94sLWIhiqkDPHiy6mBTn0puqz4cz7cIL93VZSptS8wa5yzifgBpss95jJ kGs5Bci3kCj9fSXLSZwy0UJoijxKhloUATQkgba52w6uC4A6hb8vp7/H8OF1M1jKjTGk eL+W0aAohZWcweH33jMgMtaOYCHupTM3ErTzxhDD5D/oA6KHjph5V0flsVD5A1fbgNKp 8xVmaWj4s6ISwKTwrG/whfcMydJX4t+2+vU8SueC5GW33X5ZfUYHlak7jNUpVLfoCYC+ JrtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738006789; x=1738611589; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=lXTJWVb5SeeNGKohlzscm8YBrmNhYNSXCZvoZhWgjlU=; b=tMd5Kp2RH9OpXHhVBJlt1aGwXTDXZZZkdq+EJ8vGNGzD7W1+CUv9Al5nkbP2A8R+c5 gaQ1PJLdzTjw7r1MuT2SqTL+nKBRCZKNc8IkVPXAjH7FOLzJKDWXQvkB03HHknj5i3fE 0PyHWShqikEkhmdCbtIhYOkMMl8nKZrrpzT8BXgWm6L1JWb6Nm0NkVhZsNs6k08Ri8DE cZYAvchgNUMYDi4jFJmvHiaUlZFyC4rgSdm/QKRysJLyHbL7Z7iMVLi8WfEc3r5EwKU+ yk0VgPpkiA1hAGodGxKxM3E8YU+2Fe0Xyg1lyqfWnKZUKiy0mU2/B+t0G6iDmjhrVy95 NFlA== X-Forwarded-Encrypted: i=1; AJvYcCVIdwPBEEyYoBnoU6l0SK6SEALwqpocV41btQhzsGkzMZyIrhPXzE53Fv7UgWjDBBc56BIl62iDnNLAmW34@lists.postgresql.org X-Gm-Message-State: AOJu0YxVY2F/1emS+2qoE9vfvEZ8U0dIc60sNUQQmkyVv1YEkQBrQCws 3wKmiJzYbZcsz3aCq28hEDpMJD7XAemeTMgGzJsa2Mfh4CyOEym5W+2gRw== X-Gm-Gg: ASbGncvrH+57WqBK7oR7cfxWVTEDGKczQKzn5pMMDn3S2/5gL7sIT5YvwEVK7888umw pjj51F1kaM6v5KcLCAe0WqVBkMq3Ni46q44mGaKWMGlLP0YytKJO2jqkK5scTdkSKxlFQOFUV2y YA99LCLvlVyZqkOtwHyomGmuNcFd5TdSPUIu3QBvFIp6xFDk9WlwC91gj5R7tggV/RKLbyYD3FI JZksIsuWHwLDcapGkoTQ39+u2MHgvJgsCZy//Jn7wFqRMUVZJx70cU924X71Q8daijSZTsHgt3s 3hAb7kTpwFT3OppC+W0Db74Xt9eQQ8eegZE7dhbtjuA3u/Lrds+Z0VG9hCSyevYoPK9C07E= X-Google-Smtp-Source: AGHT+IFi2qRdt3IK1RX5LdFgd/WcKZEWyHgI7FevtQMo25tamEzpjeaqm1LFTVD/fBJpk7mL/ppe/w== X-Received: by 2002:a05:6602:1555:b0:84a:5280:596f with SMTP id ca18e2360f4ac-851b64f60fbmr3804977439f.9.1738006788976; Mon, 27 Jan 2025 11:39:48 -0800 (PST) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-8521df3ffd5sm292777839f.27.2025.01.27.11.39.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2025 11:39:48 -0800 (PST) Date: Mon, 27 Jan 2025 13:39:46 -0600 From: Nathan Bossart To: Michael Banck Cc: Magnus Hagander , PostgreSQL Developers Subject: Re: Adding extension default version to \dx Message-ID: References: <67813520.170a0220.183245.7bf0@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <67813520.170a0220.183245.7bf0@mx.google.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Jan 10, 2025 at 03:56:31PM +0100, Michael Banck wrote: > 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. +1 >> 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? Yeah, "c" seems to ordinarily be used for pg_class, so +1 for changing it to "d". >> + "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? +1 Separately, I see that there's one update needed for src/test/regress/expected/psql.out. The documentation for \dx looks generic enough that it probably doesn't need any updates, though. -- nathan