pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mark Hills <mark@xwax.org>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: pgsql-performance@lists.postgresql.org
Subject: Re: Domain check taking place unnecessarily?
Date: Thu, 9 Feb 2023 11:01:41 +0000 (GMT)
Message-ID: <2302091056380.14752@stax.localdomain> (raw)
In-Reply-To: <CAKFQuwadrFMb6Ss_Wg_UqG=i_PyATT6Wg0QQCR_TT48oNfagGw@mail.gmail.com>
References: <2302081605290.5352@stax.localdomain>
	<CAKFQuwadrFMb6Ss_Wg_UqG=i_PyATT6Wg0QQCR_TT48oNfagGw@mail.gmail.com>

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





view thread (7+ messages)  latest in thread

Message-ID: <2302091056380.14752@stax.localdomain>
Permalink:  ../2302091056380.14752@stax.localdomain/
Also on:    postgresql.org/message-id/2302091056380.14752@stax.localdomain

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: mark@xwax.org, david.g.johnston@gmail.com, pgsql-performance@lists.postgresql.org
  Subject: Re: Domain check taking place unnecessarily?
  In-Reply-To: <2302091056380.14752@stax.localdomain>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox