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 1st7FX-00Dgpb-3j for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Sep 2024 15:14:47 +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 1st7FW-009KL3-3p for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Sep 2024 15:14:46 +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 1st7FV-009KKv-Qg for pgsql-hackers@lists.postgresql.org; Tue, 24 Sep 2024 15:14:45 +0000 Received: from feynman.df7cb.de ([195.49.152.168]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1st7FR-000rRz-Tg for pgsql-hackers@lists.postgresql.org; Tue, 24 Sep 2024 15:14:45 +0000 Received: from msg.df7cb.de (unknown [IPv6:2a02:908:1470:d7a0:cdb3:ed:178:ed8b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by feynman.df7cb.de (Postfix) with ESMTPSA id 4XCk1G4Nbjz3F6f; Tue, 24 Sep 2024 17:14:42 +0200 (CEST) Date: Tue, 24 Sep 2024 17:14:42 +0200 From: Christoph Berg To: Tom Lane Cc: pgsql-hackers@lists.postgresql.org Subject: Re: pgsql: Improve default and empty privilege outputs in psql. Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Re: Tom Lane > Improve default and empty privilege outputs in psql. I'm sorry to report this when 17.0 has already been wrapped, but this change is breaking `psql -l` against 9.3-or-earlier servers: $ /usr/lib/postgresql/17/bin/psql psql (17rc1 (Debian 17~rc1-1.pgdg+2), Server 9.3.25) Geben Sie »help« für Hilfe ein. postgres =# \set ECHO_HIDDEN on postgres =# \l /******* ANFRAGE ********/ SELECT d.datname as "Name", pg_catalog.pg_get_userbyid(d.datdba) as "Owner", pg_catalog.pg_encoding_to_char(d.encoding) as "Encoding", 'libc' AS "Locale Provider", d.datcollate as "Collate", d.datctype as "Ctype", NULL as "Locale", NULL as "ICU Rules", CASE WHEN pg_catalog.cardinality(d.datacl) = 0 THEN '(none)' ELSE pg_catalog.array_to_string(d.datacl, E'\n') END AS "Access privileges" FROM pg_catalog.pg_database d ORDER BY 1; /************************/ FEHLER: 42883: Funktion pg_catalog.cardinality(aclitem[]) existiert nicht ZEILE 10: CASE WHEN pg_catalog.cardinality(d.datacl) = 0 THEN '(none... ^ TIP: Keine Funktion stimmt mit dem angegebenen Namen und den Argumenttypen überein. Sie müssen möglicherweise ausdrückliche Typumwandlungen hinzufügen. ORT: ParseFuncOrColumn, parse_func.c:299 The psql docs aren't really explicit about which old versions are still supported, but there's some mentioning that \d should work back to 9.2: psql works best with servers of the same or an older major version. Backslash commands are particularly likely to fail if the server is of a newer version than psql itself. However, backslash commands of the \d family should work with servers of versions back to 9.2, though not necessarily with servers newer than psql itself. \l seems a tad more important even. Christoph