Rejecting redundant options in Create Collation

Поиск
Список
Период
Сортировка
От Daniel Verite
Тема Rejecting redundant options in Create Collation
Дата
Msg-id 540d49c2-2ed8-4dc2-a50e-4451eba24360@manitou-mail.org
обсуждение исходный текст
Ответы Re: Rejecting redundant options in Create Collation  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
  Hi,

Currently, it's not an error for CREATE COLLATION to be invoked
with options repeated several times. The last (rightmost) value is kept
and the others are lost.
For instance CREATE COLLATION x (lc_ctype='en_US.UTF8',
lc_collate='en_US.UTF8', lc_ctype='C')
silently ignores lc_ctype='en_US.UTF8'. But that kind of invocation
isn't likely to be legit. It's more plausible that it's the result of
some mistake or confusion.
The same goes for the other options:

CREATE COLLATION [ IF NOT EXISTS ] name (
    [ LOCALE = locale, ]
    [ LC_COLLATE = lc_collate, ]
    [ LC_CTYPE = lc_ctype, ]
    [ PROVIDER = provider, ]
    [ DETERMINISTIC = boolean, ]
    [ VERSION = version ]
)

I suggest the attached simple patch to raise an error when any of
these options is specified multiple times.


Best regards,
--
Daniel Vérité
PostgreSQL-powered mailer: https://www.manitou-mail.org
Twitter: @DanielVerite

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: WIP: BRIN multi-range indexes
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Rejecting redundant options in Create Collation