pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
dropped default locale
5+ messages / 3 participants
[nested] [flat]

* dropped default locale
@ 2022-12-21 14:24 Karsten Hilbert <Karsten.Hilbert@gmx.net>
  2022-12-21 14:41 ` Re: dropped default locale Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 1 reply; 5+ messages in thread

From: Karsten Hilbert @ 2022-12-21 14:24 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

Dear all,

I managed to drop the "special" collations default, C, and
POSIX with OIDs 100, 950, 951.

Is there a way to recreate them (short of restoring a backup)
? Naive attempts with create collation do not seem to work
out.

Thanks,
Karsten
--
GPG  40BE 5B0E C98E 1713 AFA6  5BC0 3BEA AC80 7D4F C89B





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: dropped default locale
  2022-12-21 14:24 dropped default locale Karsten Hilbert <Karsten.Hilbert@gmx.net>
@ 2022-12-21 14:41 ` Laurenz Albe <laurenz.albe@cybertec.at>
  2022-12-21 14:46   ` Re: dropped default locale Karsten Hilbert <Karsten.Hilbert@gmx.net>
  0 siblings, 1 reply; 5+ messages in thread

From: Laurenz Albe @ 2022-12-21 14:41 UTC (permalink / raw)
  To: Karsten Hilbert <Karsten.Hilbert@gmx.net>; pgsql-general@lists.postgresql.org

On Wed, 2022-12-21 at 15:24 +0100, Karsten Hilbert wrote:
> I managed to drop the "special" collations default, C, and
> POSIX with OIDs 100, 950, 951.
> 
> Is there a way to recreate them (short of restoring a backup)
> ? Naive attempts with create collation do not seem to work
> out.

I would definitely go for the backup, but here is how you can
create these three rows in PostgreSQL v15:

  INSERT INTO pg_collation
    (oid, collname, collnamespace, collowner, collprovider,
     collisdeterministic, collencoding, collcollate, collctype)
  VALUES
    (100, 'default', 11, 10, 'd', TRUE, -1, NULL,    NULL),
    (950, 'C',       11, 10, 'c', TRUE, -1, 'C',     'C'),
    (951, 'POSIX',   11, 10, 'c', TRUE, -1, 'POSIX', 'POSIX');

Yours,
Laurenz Albe





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: dropped default locale
  2022-12-21 14:24 dropped default locale Karsten Hilbert <Karsten.Hilbert@gmx.net>
  2022-12-21 14:41 ` Re: dropped default locale Laurenz Albe <laurenz.albe@cybertec.at>
@ 2022-12-21 14:46   ` Karsten Hilbert <Karsten.Hilbert@gmx.net>
  2022-12-21 14:51     ` Re: dropped default locale Karsten Hilbert <Karsten.Hilbert@gmx.net>
  0 siblings, 1 reply; 5+ messages in thread

From: Karsten Hilbert @ 2022-12-21 14:46 UTC (permalink / raw)
  To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: pgsql-general@lists.postgresql.org

Am Wed, Dec 21, 2022 at 03:41:24PM +0100 schrieb Laurenz Albe:

> I would definitely go for the backup, but here is how you can
> create these three rows in PostgreSQL v15:
>
>   INSERT INTO pg_collation
>     (oid, collname, collnamespace, collowner, collprovider,
>      collisdeterministic, collencoding, collcollate, collctype)
>   VALUES
>     (100, 'default', 11, 10, 'd', TRUE, -1, NULL,    NULL),
>     (950, 'C',       11, 10, 'c', TRUE, -1, 'C',     'C'),
>     (951, 'POSIX',   11, 10, 'c', TRUE, -1, 'POSIX', 'POSIX');

Many thanks !  I wasn't so sure whether inserting appropriate
rows would be equivalent to create collation... (pg_collation
might have been a view projecting inner workings of the
server engine).

Thanks,
Karsten
--
GPG  40BE 5B0E C98E 1713 AFA6  5BC0 3BEA AC80 7D4F C89B





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: dropped default locale
  2022-12-21 14:24 dropped default locale Karsten Hilbert <Karsten.Hilbert@gmx.net>
  2022-12-21 14:41 ` Re: dropped default locale Laurenz Albe <laurenz.albe@cybertec.at>
  2022-12-21 14:46   ` Re: dropped default locale Karsten Hilbert <Karsten.Hilbert@gmx.net>
@ 2022-12-21 14:51     ` Karsten Hilbert <Karsten.Hilbert@gmx.net>
  2022-12-21 15:14       ` Re: dropped default locale Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 5+ messages in thread

From: Karsten Hilbert @ 2022-12-21 14:51 UTC (permalink / raw)
  To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: pgsql-general@lists.postgresql.org

Am Wed, Dec 21, 2022 at 03:46:48PM +0100 schrieb Karsten Hilbert:

> I wasn't so sure whether inserting appropriate
> rows would be equivalent to create collation...

For that matter, is DELETE FROM pg_collation ... equivalent
to DROP COLLATION ?

Thanks,
Karsten
--
GPG  40BE 5B0E C98E 1713 AFA6  5BC0 3BEA AC80 7D4F C89B





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: dropped default locale
  2022-12-21 14:24 dropped default locale Karsten Hilbert <Karsten.Hilbert@gmx.net>
  2022-12-21 14:41 ` Re: dropped default locale Laurenz Albe <laurenz.albe@cybertec.at>
  2022-12-21 14:46   ` Re: dropped default locale Karsten Hilbert <Karsten.Hilbert@gmx.net>
  2022-12-21 14:51     ` Re: dropped default locale Karsten Hilbert <Karsten.Hilbert@gmx.net>
@ 2022-12-21 15:14       ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 5+ messages in thread

From: Tom Lane @ 2022-12-21 15:14 UTC (permalink / raw)
  To: Karsten Hilbert <Karsten.Hilbert@gmx.net>; +Cc: Laurenz Albe <laurenz.albe@cybertec.at>; pgsql-general@lists.postgresql.org

Karsten Hilbert <Karsten.Hilbert@gmx.net> writes:
> For that matter, is DELETE FROM pg_collation ... equivalent
> to DROP COLLATION ?

There's also entries in pg_depend and pg_shdepend to worry
about.

For these built-in collations, as of v15 there are no such
entries, but prior versions had explicit "pin" entries.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2022-12-21 15:14 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-12-21 14:24 dropped default locale Karsten Hilbert <Karsten.Hilbert@gmx.net>
2022-12-21 14:41 ` Laurenz Albe <laurenz.albe@cybertec.at>
2022-12-21 14:46   ` Karsten Hilbert <Karsten.Hilbert@gmx.net>
2022-12-21 14:51     ` Karsten Hilbert <Karsten.Hilbert@gmx.net>
2022-12-21 15:14       ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox