Re: Order of enforcement of CHECK constraints?

Поиск
Список
Период
Сортировка
От David Steele
Тема Re: Order of enforcement of CHECK constraints?
Дата
Msg-id 550ED20C.9080104@pgmasters.net
обсуждение исходный текст
Ответ на Re: Order of enforcement of CHECK constraints?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Order of enforcement of CHECK constraints?  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-hackers
On 3/20/15 3:37 PM, Tom Lane wrote:
> Fabrízio de Royes Mello <fabriziomello@gmail.com> writes:
>> On Fri, Mar 20, 2015 at 4:19 PM, Peter Geoghegan <pg@heroku.com> wrote:
>>> On Fri, Mar 20, 2015 at 12:15 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>>> We could fix it by, say, having CheckConstraintFetch() sort the
>>>> constraints by name after loading them.
>
>>> What not by OID, as with indexes? Are you suggesting that this would
>>> become documented behavior?
>
>> I think they should be executed in alphabetical order like triggers.
>
> Yeah.  We already have a comparable, and documented, behavior for
> triggers, so if we're going to do anything about this I'd vote for
> sorting by name (or more specifically, by strcmp()).
>
>             regards, tom lane

+1 for strcmp() ordering.  Not only is this logical and consistent with
the way triggers are fired, names can be manipulated by the user to
force order when desired.  Not sure if that's as important for check
constraints as it is for triggers but it might be useful, even if only
for things like unit tests.

--
- David Steele
david@pgmasters.net


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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Remove fsync ON/OFF as a visible option?
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Order of enforcement of CHECK constraints?