Re: Domain check constraint not honored?

From: Eric Schwarzenbach <subscriber(at)blackbrook(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Domain check constraint not honored?
Date: 2015-10-29 22:29:15
Message-ID: 56329DBB.8060800@blackbrook.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David E. Wheeler 2015-10-29 22:31:10 Re: pgxs/config/missing is... missing
Previous Message Thomas Kellerer 2015-10-29 22:01:33 Re: Configure Different Databases on One Server