Re: PostgreSQL CHARACTER VARYING vs CHARACTER VARYING (Length) - Mailing list pgsql-admin

From David G. Johnston
Subject Re: PostgreSQL CHARACTER VARYING vs CHARACTER VARYING (Length)
Date
Msg-id CAKFQuwZ2t2m2=M_sJrMfGKjy4LeoYuL0rGBojRXvxB9qh8P3gg@mail.gmail.com
Whole thread Raw
In response to Re: PostgreSQL CHARACTER VARYING vs CHARACTER VARYING (Length)  (Rui DeSousa <rui@crazybean.net>)
Responses Re: PostgreSQL CHARACTER VARYING vs CHARACTER VARYING (Length)  (Rui DeSousa <rui@crazybean.net>)
List pgsql-admin
On Tue, Apr 28, 2020 at 5:21 PM Rui DeSousa <rui@crazybean.net> wrote:
I just use "text" for everything. It's less typing. :-)
Ugh, I see it as sign that the designers of the schema didn’t fully think about the actual requirements or care about them and it usually shows.    

There are very few situations where a non-arbitrary free-form text field is going to have a non-arbitrary length constraint - that is also immutable.  Generally, spending time to figure out those rare exceptions is wasted effort better spent elsewhere.  They are also mostly insufficient when used for their typical "protection" purpose.  If you really want protection add well thought out constraints.

Its less problematic now that increasing the generally arbitrary length doesn't require a table rewrite but you still need to rebuild dependent objects.

David J.

pgsql-admin by date:

Previous
From: Rui DeSousa
Date:
Subject: Re: PostgreSQL CHARACTER VARYING vs CHARACTER VARYING (Length)
Next
From: Rui DeSousa
Date:
Subject: Re: PostgreSQL CHARACTER VARYING vs CHARACTER VARYING (Length)