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 1sImAt-000JzB-8n for pgsql-general@arkaria.postgresql.org; Sun, 16 Jun 2024 09:27: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 1sImAp-0053DT-Di for pgsql-general@arkaria.postgresql.org; Sun, 16 Jun 2024 09:27:44 +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 1sImAp-0053DF-05 for pgsql-general@lists.postgresql.org; Sun, 16 Jun 2024 09:27:43 +0000 Received: from mout.gmx.net ([212.227.15.19]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sImAm-001ZVs-BQ for pgsql-general@lists.postgresql.org; Sun, 16 Jun 2024 09:27:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1718530056; x=1719134856; i=karsten.hilbert@gmx.net; bh=cUFAoWWwVpo2DTb8GPcBtIT9zoksUn8JctS8Sv3z1cg=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To: cc:content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=DCLR0Z03EG6O7C0qohEvBWuvCPjrUB6ZrKk9vrlxv9k+ekBYI3rF/a7IUhzztSJE zbENdfYcDLOdeehdhoLJBuLO225P/JKHkw4Rvxc6XSoVY30NJNzB9l3g74guEij1c FYMbF+j8rUb8phyZt1syY5IlW+isY96QiSlwhTR5YJ/1yPLV4KOc1bk31wLtbD1Tx N32a6IY9E4C8g9ea9OPVOPwyXm56w6bBfawt3GmTrA1/lfUH9h+rRWAACaSQ/moIB SYY3q5wt3+ov+6tTpWW6DO13XCU94y4L/pimpGQF9F7MKboN4Bwznbrz+U8i4fmlU V/G837P5Bg2YOPcN/Q== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from hermes ([84.144.215.28]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MSKuA-1rqDlw1m6y-00US4w; Sun, 16 Jun 2024 11:27:36 +0200 Received: from ncq by hermes with local (Exim 4.96) (envelope-from ) id 1sImAh-0004V4-20; Sun, 16 Jun 2024 11:27:35 +0200 Date: Sun, 16 Jun 2024 11:27:35 +0200 From: Karsten Hilbert To: Laurenz Albe Cc: pgsql-general@lists.postgresql.org Subject: Re: DROP COLLATION vs pg_collation question Message-ID: References: <26f717988471c4d672cce8c495a2c8e68446486a.camel@cybertec.at> <56da532b44bc02a7648796041ffa5da0a85c06df.camel@cybertec.at> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <56da532b44bc02a7648796041ffa5da0a85c06df.camel@cybertec.at> Ma_X_il-Followup-to: d Re_X_turn-receipt-to: Karsten.Hilbert@gmx.net Di_X_sposition-Notification-To: Karsten.Hilbert@gmx.net X-Confi_X_rm-Reading-To: Karsten.Hilbert@gmx.net X-Pri_X_ority: 2 (High) Sender: X-Provags-ID: V03:K1:MvgsYR6+ZUKRKL6ZF3HPaJA2Ekw6oxL2ACGEInabJkF1CUYIQVE kcNOnszSNwtj+FRFBpAKV4p8xNfBFekuZ83uUTkQOVHBMF9+Fm0OQxbtz7Jns17URIjHw8X 0BETyvHeTNYL2+iXnDU/dCpJMw00MfOxYmZdLoKMZpn04BXoVfl1DO5BFtSaVzuuhNSdkHr NaKvFmRFAvu6YfY/LPCXg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:xYwluJbjlAs=;bKa4zkWj5O8Rke/XAPyzLKsdWNs 1ByKs+KibCMU5SAMtXNkGKygFd0hCP4FsZ1SnuHqyO3HjlqRlzP8cVnDlvw85qUB1KWtNIcmc v/UeJDrg83+FOY8sGYASXJIGU604vLeyiTfUrjxsdV/uQZYG7tlX7EUH1W6YMs2dcXMBfHpmM V5+q09k0Y4v3QPGB2TFvXA8B8boCqC4fRNdEKC9QwZEL/xb9dq6tauA6uiGUXryJWwOIewJk5 uHA1jcTD6SrY2UrjDRvSoKc7CDaOE557bOO3ujAmXAyYMaQYKABfFq2IG5D0LrtOhvQQU1Tw8 y07Ios9vjPJAbjnenXoJTQ2o/yogNOFFC3bDrZkcdsEN/wiF6hFABa52SClWjD4CliQ2m4s88 XBGq609ATyumAiWJivGZ4FiGmuZwY0Iiz9xy9/4VPpUFw+C55MW5aE84ZDe5k6ag5rRNgvinN XtlhsXIThxKTraRu7Ox0SGM5wjZvh+7XIfS7mfod6J7k4079qAiJe+rI47g7RHDXhTlMBh3VP H4kmsUAdZ174OZoa5qrk2+rJb/RQKW7t99ax9MejW79lJ8enhsDlSbarJLhM8Hl/AJYw3/RdV be3JGS7Pz/C5jnIwfYUIvGeSKdrcJH36l5NeWWnSyvSYVnX1o5Gh8SUowkxNYJLg6VMl7S/F/ VHmL6V23Nztvp3WP2IEuw5mVMz47iV4UxNREOqoudqXIFHoYk6ZEFsNqpp6CFeQ6Ow3LzxRDv ZYiRod1WlEbVBERh8wzmkm5xf0nkBvXSd9eeFhm7HiIBD3T6dE53EcVqVgIGtURLhcwwMCFpC tknLZRtvz0YodAGFibi6dA5eAeAg65NmvK3nVmuBuB1Cw= List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Am Sun, Jun 16, 2024 at 06:53:31AM +0200 schrieb Laurenz Albe: > On Fri, 2024-06-14 at 22:08 +0200, Karsten Hilbert wrote: > > Are collations per-database or per-cluster objects ? > > Each database has its own "pg_collation" catalog table. > > So they are local to the database, I would have thought so, thanks for confirming. > but the collations themselves > are defined by an external library, so the implementation is shared. Which in turn means I cannot at all truly _remove_ collations from a cluster at the SQL level, only make them invisible (and thereby not-to-be-used) inside a particular database by removing them from pg_collations via DROP COLLATION, right ? > > 3) update collation version information in pg_collations for > > =A0=A0 collations intended for an encoding different from the > > =A0=A0 database encoding (ALTER COLLATION ... REFRESH VERSION fails) > > > > which in effect would mean that -- upon change of collation > > versions in the underlying operating system (ICU update, libc > > update) -- one would have to live with outdated version > > information in pg_collations short of dump/sed/restore or > > some such ? > > That should not happen. What error do you get when you > > ALTER COLLATION ... REFRESH VERSION The error I got was to the effect of insufficient permissions (the connected user wasn't the owner of the collation). ALTERing as superuser updated collation version information just fine, so PEBKAC. For the record: Yes, collation versions CAN be updated regardless of whether a given collation applies to the database's encoding. > Does the following give you the same error? > > ALTER DATABASE ... REFRESH COLLATION VERSION That did not show the same error because I ran it as database owner (?). The database owner does not own the collations, however, which made the above fail. Thanks, Karsten =2D- GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B