Обсуждение: CREATE COLLATION to match pg_collation data

Поиск
Список
Период
Сортировка

CREATE COLLATION to match pg_collation data

От
rihad
Дата:

Hi, since pg_import_system_collations() that would solve all this doesn't exist in 9.6.x, is there a way to I properly map it to a CREATE COLLATE call? Specifically I need to have this collation (from 10.x) in 9.6.x so it works on FreeBSD:


        collname        | collnamespace | collowner | collprovider | collencoding |    collcollate    |     collctype     | collversion
------------------------+---------------+-----------+--------------+--------------+-------------------+-------------------+-------------

 az-x-icu               |            11 |        10 | i            |           -1 | az                | az                | 153.88.34



CREATE COLLATION name (   [ LOCALE = locale, ]   [ LC_COLLATE = lc_collate, ]   [ LC_CTYPE = lc_ctype ]
)
CREATE COLLATION name FROM existing_collation

https://www.postgresql.org/docs/9.6/sql-createcollation.html


Can I just not use "create collation", and simply insert the new row as is?

Thanks for any tips.

Re: CREATE COLLATION to match pg_collation data

От
Tom Lane
Дата:
rihad <rihad@mail.ru> writes:
> Hi, since pg_import_system_collations() that would solve all this
> doesn't exist in 9.6.x, is there a way to I properly map it to a CREATE
> COLLATE call? Specifically I need to have this collation (from 10.x) in
> 9.6.x so it works on FreeBSD:

>          collname        | collnamespace | collowner | collprovider |
> collencoding |    collcollate    | collctype     | collversion
>
------------------------+---------------+-----------+--------------+--------------+-------------------+-------------------+-------------
>   az-x-icu               |            11 |        10 | i           
> |           -1 | az                | az                | 153.88.34

That's an ICU collation, so you're out of luck: there is no ICU
support in 9.6.

            regards, tom lane


Re: CREATE COLLATION to match pg_collation data

От
Peter Geoghegan
Дата:
On Sat, Jan 12, 2019 at 7:13 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> That's an ICU collation, so you're out of luck: there is no ICU
> support in 9.6.

FWIW, there is some form of FreeBSD Postgres support for ICU that
predates the officially supported ICU feature. The FreeBSD Postgres
packages have been built with ICU support for many years -- they
modify the source code minimally to make this work. It may well still
be impossible to use "az-x-icu" on a FreeBSD installation of 9.6,
though.

-- 
Peter Geoghegan