Re: Domain check taking place unnecessarily?

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Mark Hills <mark(at)xwax(dot)org>
Cc: pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: Domain check taking place unnecessarily?
Date: 2023-02-08 18:09:18
Message-ID: CAKFQuwadrFMb6Ss_Wg_UqG=i_PyATT6Wg0QQCR_TT48oNfagGw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Wed, Feb 8, 2023 at 11:01 AM Mark Hills <mark(at)xwax(dot)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.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Benjamin Tingle 2023-02-08 19:45:09 Window Functions & Table Partitions
Previous Message Mark Hills 2023-02-08 18:01:23 Domain check taking place unnecessarily?