Re: DOMAIN usability

Lists: pgsql-general
From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Rajesh Kumar Mallah <mallah(at)trade-india(dot)com>
Cc: pgsql <pgsql-general(at)postgresql(dot)org>
Subject: Re: DOMAIN usability
Date: 2003-11-13 17:50:11
Message-ID: Pine.LNX.4.44.0311131848190.17499-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Rajesh Kumar Mallah writes:

> *1.* Suppose varchar(30) turns out to be too small oneday
> and we want to increase it to varchar(100) , what do i do ?

This is no different from the problem of changing a column type in place.
It's still being worked on.

> *2.* Its difficult to see all the constraint defs on a domain .
> information_schema.domain_constriants does not have the
> definations just the names are present.

You need to join domain_constraints and check_constraints.

--
Peter Eisentraut peter_e(at)gmx(dot)net


From: Jeff <threshar(at)torgo(dot)978(dot)org>
To: Rajesh Kumar Mallah <mallah(at)trade-india(dot)com>
Cc: peter_e(at)gmx(dot)net, pgsql-general(at)postgresql(dot)org
Subject: Re: DOMAIN usability
Date: 2003-11-13 19:02:18
Message-ID: 20031113140218.475d8fd4.threshar@torgo.978.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Fri, 14 Nov 2003 23:43:26 +0530
Rajesh Kumar Mallah <mallah(at)trade-india(dot)com> wrote:

>
> BTW: Searching on archives.postgresql.org takes ages is it using FTS?
>

Groups.google.com has indexes of the mailing lists so you can use that
to search. I do because archives is unusably slow.

you know. we should do something about that :)

--
Jeff Trout <jeff(at)jefftrout(dot)com>
http://www.jefftrout.com/
http://www.stuarthamm.net/


From: Rajesh Kumar Mallah <mallah(at)trade-india(dot)com>
To: pgsql <pgsql-general(at)postgresql(dot)org>
Subject: DOMAIN usability
Date: 2003-11-14 17:24:22
Message-ID: 3FB50FC6.5000009@trade-india.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general


Hi ,

I think one of the usage patterns of DOMAINS is
to have size specifications and validity constraints
at one place for easy administration of Database.

Eg, instead of declaring email to be varchar(30) in
10s of tables and putting a CHECK constraint for
presence of '@' we could declare

CREATE DOMAIN email_type varchar (30) CHECK ( value ~* '@') ;

And users could use "email_type" in our CREATE TABLEs .

There are two main issues (problems)

*1.* Suppose varchar(30) turns out to be too small oneday
and we want to increase it to varchar(100) , what do i do ?
a) Create a new domain ,
b) Apply all the constraints on new domain
c) Create new column in each of the tables and copy the old column
d) drop the old domain cascaded.

any other more elegent method ?

*2.* Its difficult to see all the constraint defs on a domain .
information_schema.domain_constriants does not have the
definations just the names are present.

Regards
Mallah.


From: Rajesh Kumar Mallah <mallah(at)trade-india(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql <pgsql-general(at)postgresql(dot)org>
Subject: Re: DOMAIN usability
Date: 2003-11-14 18:13:26
Message-ID: 3FB51B46.3080708@trade-india.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Peter Eisentraut wrote:

>Rajesh Kumar Mallah writes:
>
>
>
>>*1.* Suppose varchar(30) turns out to be too small oneday
>> and we want to increase it to varchar(100) , what do i do ?
>>
>>
>
>This is no different from the problem of changing a column type in place.
>It's still being worked on.
>

Yes i realize so. But what could be in principle wrong to allow increasing
storage size only eg varchar(30) to varchar(100) not integer to
varchar(100)
etc. I remeber there was already a long thread of discussion on it.

BTW: Searching on archives.postgresql.org takes ages is it using FTS?

>
>
>
>>*2.* Its difficult to see all the constraint defs on a domain .
>> information_schema.domain_constriants does not have the
>> definations just the names are present.
>>
>>
>
>You need to join domain_constraints and check_constraints.
>
thanks.

Regds
Mallah.

>
>
>

--

Rajesh Kumar Mallah,
Infocom Network Limited, New Delhi
phone: +91(11)6152172 (221) (L) ,9811255597 (M)

Visit http://www.trade-india.com ,
India's Leading B2B eMarketplace.