From: | "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com> |
---|---|
To: | Martijn van Oosterhout <kleptog(at)svana(dot)org> |
Cc: | Michael Enke <michael(dot)enke(at)wincor-nixdorf(dot)com>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: self defined data type "with limit"? |
Date: | 2007-06-27 16:50:03 |
Message-ID: | 4682953B.7000503@commandprompt.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Martijn van Oosterhout wrote:
> On Wed, Jun 27, 2007 at 02:08:43PM +0200, Michael Enke wrote:
>> Hello everyone,
>> I have created a new data type "mychar". How can I specify a limit for it?
>>
>> This (unlimited version) works fine:
>> create table table_a(col_a mychar);
>
> What you want is called "user defined typmod" and I don't beleive any
> released version has it, but it will be in the next release.
I believe he could do it with a domain.
create domain myreal_char as varchar(50);
create table table_a(col_a myreal_char);
Joshua D. Drake
>
> Have a nice day,
--
=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/
Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL Replication: http://www.commandprompt.com/products/
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Enke | 2007-06-27 17:11:16 | Re: self defined data type "with limit"? |
Previous Message | Eric | 2007-06-27 16:32:13 | GiST consistent function, expected arguments; multi-dimensional indexes |