Re: composite type and domain

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Grzegorz Jaśkiewicz <gryzman(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: composite type and domain
Date: 2009-05-27 14:02:36
Message-ID: b42b73150905270702l65677cf3vf2e3c59455b6477f@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2009/5/25 Grzegorz Jaśkiewicz <gryzman(at)gmail(dot)com>:
> Why is it not possible to create domain on composite type ?
>
> Consider the example, I got (a bytea, b timestamp, c timestamp). Where
> b < c always, and both b and c have some default value, a can stay
> null.
> Now, I don't want to go berserk, and create aditional table for that,
> because type is shared between two tables. But it would be nice, to be
> able to create domain based on that type.
> Any reasons I can't , or is it just something I do wrong?

Another potential way of getting there is to define a table with a
table constraint that gives you what you want...and use the table for
your composite (I usually do this anyways). This doesn't work either,
because table constraints aren't enforced during casts....maybe they
should be?

merlin

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Iv Ray 2009-05-27 14:18:18 Re: a strange error, resolved
Previous Message Merlin Moncure 2009-05-27 13:58:04 Re: Regular expression and array