RES: Chante domain type - Postgres 9.2

From: Márcio A(dot) Sepp <marcio(at)zyontecnologia(dot)com(dot)br>
To: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "'Rakesh Kumar'" <rakeshkumar464(at)outlook(dot)com>
Cc: "'pgsql-general'" <pgsql-general(at)postgresql(dot)org>
Subject: RES: Chante domain type - Postgres 9.2
Date: 2016-09-26 16:59:07
Message-ID: 052601d21817$4b8f6990$e2ae3cb0$@com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> > Can you elaborate? Why would anyone create a text column to store
> customer name or product name which can very well be in varchar(50)
> type of cols.
>
> You sound like you think that varchar(50) is somehow cheaper than text.
> That's backwards (at least in PG, other DBMSes may be different).
> There's no advantage storage-wise, and there is a cost, namely the cost
> of applying the length check on every update.
>
> If you feel that you must have a check for application-specific
> reasons, then sure, use varchar(n). But the number had better be one
> that you can trace to crystal-clear application requirements.
> varchar(n) where n has been plucked from the air is a good sign of bad
> database design.

What a about using text x varchar(n) in primary key?

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adam Brusselback 2016-09-26 17:56:18 Incrementally refreshed materialized view
Previous Message David G. Johnston 2016-09-26 16:23:52 Re: [HACKERS] temporary table vs array performance