Re: Domain check taking place unnecessarily? - Mailing list pgsql-performance

From David G. Johnston
Subject Re: Domain check taking place unnecessarily?
Date
Msg-id CAKFQuwadrFMb6Ss_Wg_UqG=i_PyATT6Wg0QQCR_TT48oNfagGw@mail.gmail.com
Whole thread Raw
In response to Domain check taking place unnecessarily?  (Mark Hills <mark@xwax.org>)
Responses Re: Domain check taking place unnecessarily?  (Mark Hills <mark@xwax.org>)
List pgsql-performance
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...).

David J.

pgsql-performance by date:

Previous
From: Mark Hills
Date:
Subject: Domain check taking place unnecessarily?
Next
From: Benjamin Tingle
Date:
Subject: Window Functions & Table Partitions