Re: Domain check taking place unnecessarily?

Поиск
Список
Период
Сортировка
От Mark Hills
Тема Re: Domain check taking place unnecessarily?
Дата
Msg-id 2302091056380.14752@stax.localdomain
обсуждение исходный текст
Ответ на Re: Domain check taking place unnecessarily?  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-performance
On Wed, 8 Feb 2023, David G. Johnston wrote:

> On Wed, Feb 8, 2023 at 11:01 AM Mark Hills <mark@xwax.org> wrote:
> 
> >
> > CREATE DOMAIN hash AS text
> >     CHECK (VALUE ~ E'^[a-zA-Z0-9]{8,32}$');
> >
> > devstats=> ALTER TABLE invite ADD COLUMN test hash;
> > ALTER TABLE
> > Time: 30923.380 ms (00:30.923)
> >
> 
> Necessarily, I presume because if you decided that the check on the domain
> should be "value is not null" (don't do this though...) the column addition
> would have to fail for existing rows (modulo defaults...).

I'm not sure I'm parsing this paragraph correctly, but the existing rows 
don't provide any data to the domain check. Perhaps you could clarify.

Many thanks

-- 
Mark



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

Предыдущее
От: Mark Hills
Дата:
Сообщение: Re: Domain check taking place unnecessarily?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Domain check taking place unnecessarily?