Search Postgresql Archives

Re: citext question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Oct 13, 2012, at 6:34 PM, David Johnston <polobo@xxxxxxxxx> wrote:

>> 
>> Hi
>> 
>> I have played around a bit with the citext
>> extention. It looks like it is a lot like the
>> text data type - allmost like a memo
>> field. Is there any way to restrict the
>> length of citext fields, like char and
>> varchar fields? 
>> 
>> Thanks
>> 
>> H.F.
>> 
> 
> Try "citext(25)"...if it works then "yes" otherwise "no"...

No, citext(length) not supported. 

However, you can define check constraint, if that fulfill your requirement as given below:
create table test2(col citext check(length(col) < 3));
Or 
you can create a domain which you can use in CREATE TABLE command as given below:
CREATE domain citext_char as CITEXT CHECK(length(value) <= 3); 

Thanks & Regards,
Vibhor Kumar
EnterpriseDB Corporation
The Enterprise PostgreSQL Company
Blog: http://vibhork.blogspot.com



-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux