Re: Domain check constraint not honored? - Mailing list pgsql-general

From Eric Schwarzenbach
Subject Re: Domain check constraint not honored?
Date
Msg-id 56329DBB.8060800@blackbrook.org
Whole thread Raw
In response to Re: Domain check constraint not honored?  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: Domain check constraint not honored?
Re: Domain check constraint not honored?
Re: Domain check constraint not honored?
List pgsql-general
On 10/29/2015 03:44 PM, Alvaro Herrera wrote:
> Rob Sargent wrote:
>
>> Also thought I should mention that there is an ip address type if that's
>> what you're trying to accomplish.
> Looking at the domain name, I wonder whether contrib/ltree would be
> helpful.
Very observant! This is indeed part of a hierarchical data solution.
Thanks for the suggestion, but this solution has been in place and
working for a few years already. I'm not positive, but I think I may
have looked at ltree when I first implemented it, but decided against it
in favor of a transitive closure table, augmented with this path for
sorting.
(I do sometimes wonder whether the transitive closure table is worth it
vs just a materialized path.)

I'm just now converting that path to use a custom domain (along with
custom operators) instead of just being a string. (The custom operators
allow the paths to be sorted properly without each segment needing to be
filled with zeros to a fixed length.) (Also FWIW, the latest version of
this regexp is now '^([0-9]+.)*[0-9]+$')



Cheers,

Eric


pgsql-general by date:

Previous
From: Thomas Kellerer
Date:
Subject: Re: Configure Different Databases on One Server
Next
From: "David E. Wheeler"
Date:
Subject: Re: pgxs/config/missing is... missing