Re: composite type and domain

From: Scott Bailey <artacus(at)comcast(dot)net>
To: Grzegorz Jaśkiewicz <gryzman(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: composite type and domain
Date: 2009-05-29 17:53:51
Message-ID: 4A20212F.8060200@comcast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Grzegorz Jaśkiewicz wrote:
> On Fri, May 29, 2009 at 3:37 AM, Scott Bailey <artacus(at)comcast(dot)net> wrote:
>> Did you read the article I sent you earlier?
>
> Well, the difference here is that this way db doesn't really check
> anything :) you just choose path of execution, that you created prior.
> That's cheating :p
>
> So yes, I read that article, but that's not the right solution, it
> gives you an illusion, only if you use it the way it was meant to be
> (tm).

Fair enough, but:
1) There's nothing wrong with cheating
2) By raising an exception in the constructors when b > c, you'll get
almost the same behavior as having a domain.
3) You can't do what you want in Postgres so your only other options are
to hack the code for domains so they work with complex types or build
your type in C and create your own I/O functions... both of those are a
whole lot more work.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2009-05-29 18:16:26 Re: [GENERAL] trouble with to_char('L')
Previous Message Emanuel Calvo Franco 2009-05-29 17:53:12 Re: Pl/java in 8.4 bet1 sources compilation failed