Re: DROP COLLATION vs pg_collation question

2024-06-18 Thread Adrian Klaver
On 6/18/24 06:32, Karsten Hilbert wrote: Am Tue, Jun 18, 2024 at 03:02:56PM +0200 schrieb Karsten Hilbert: I see, and since any database can be used as a template for more databases, which can be create with an encoding different from the template, Proving myself wrong: root@hermes:~/tmp# s

Re: DROP COLLATION vs pg_collation question

2024-06-18 Thread Karsten Hilbert
Am Tue, Jun 18, 2024 at 03:02:56PM +0200 schrieb Karsten Hilbert: > I see, and since any database can be used as a template for > more databases, which can be create with an encoding > different from the template, Proving myself wrong: root@hermes:~/tmp# sudo -u postgres psql -e -f /tmp/db.sql

Re: DROP COLLATION vs pg_collation question

2024-06-18 Thread Karsten Hilbert
Am Sun, Jun 16, 2024 at 04:38:49PM -0400 schrieb Tom Lane: > It's really kind of moot, since you can't change the encoding > of an existing database. So any pg_collation entries that are > for an incompatible encoding cannot be used for anything in that > database, and they might as well not be t

Re: DROP COLLATION vs pg_collation question

2024-06-16 Thread Tom Lane
Laurenz Albe writes: > On Sun, 2024-06-16 at 11:27 +0200, Karsten Hilbert wrote: >> 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_co

Re: DROP COLLATION vs pg_collation question

2024-06-16 Thread Laurenz Albe
On Sun, 2024-06-16 at 11:27 +0200, Karsten Hilbert wrote: > > 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 ther

Re: DROP COLLATION vs pg_collation question

2024-06-16 Thread Karsten Hilbert
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 thoug

Re: DROP COLLATION vs pg_collation question

2024-06-15 Thread 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, but the collations themselves are defined by an external library, so the implementation is sh

Re: DROP COLLATION vs pg_collation question

2024-06-14 Thread Karsten Hilbert
Am Thu, Jun 13, 2024 at 09:49:46AM +0200 schrieb Laurenz Albe: > > > Note that with DROP COLLATION you can only remove collations > > > that belong to the encoding of your current database. > > src/backend/catalog/namespace.c: > > /* >* get_collation_oid - find a collation by possibly qualif

Re: DROP COLLATION vs pg_collation question

2024-06-13 Thread Laurenz Albe
On Wed, 2024-06-12 at 21:13 +0200, Karsten Hilbert wrote: > > Note that with DROP COLLATION you can only remove collations > > that belong to the encoding of your current database. > > A-ha !  Can that bit be found anywhere in the docs ? src/backend/catalog/namespace.c: /* * get_collation_o

Re: DROP COLLATION vs pg_collation question

2024-06-12 Thread Karsten Hilbert
> > DROP COLLATION IF EXISTS pg_catalog."" > > Yes, that will delete a row from "pg_collation". Many thanks. > Note that with DROP COLLATION you can only remove collations > that belong to the encoding of your current database. A-ha ! Can that bit be found anywhere in the docs ? IOW, t

Re: DROP COLLATION vs pg_collation question

2024-06-12 Thread Laurenz Albe
On Tue, 2024-06-11 at 23:15 +0200, Karsten Hilbert wrote: > maybe a naive question but I was unable to find an answer in > the fine manual (sv_SE being an example) > > Does running > > DROP COLLATION IF EXISTS pg_catalog."sv_SE" > > also remove the corresponding row from pg_collation (assu

DROP COLLATION vs pg_collation question

2024-06-11 Thread Karsten Hilbert
Dear list members, maybe a naive question but I was unable to find an answer in the fine manual (sv_SE being an example) Does running DROP COLLATION IF EXISTS pg_catalog."sv_SE" also remove the corresponding row from pg_collation (assuming nothing depends on collation sv_SE) ? Experime