Re: self defined data type "with limit"? - Mailing list pgsql-hackers

From Joshua D. Drake
Subject Re: self defined data type "with limit"?
Date
Msg-id 4682953B.7000503@commandprompt.com
Whole thread Raw
In response to Re: self defined data type "with limit"?  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: self defined data type "with limit"?  (Michael Enke <michael.enke@wincor-nixdorf.com>)
List 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/



pgsql-hackers by date:

Previous
From: Eric
Date:
Subject: GiST consistent function, expected arguments; multi-dimensional indexes
Next
From: Michael Enke
Date:
Subject: Re: self defined data type "with limit"?