Re: PostgreSQL CHARACTER VARYING vs CHARACTER VARYING (Length)

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Rui DeSousa <rui(at)crazybean(dot)net>
Cc: raf <raf(at)raf(dot)org>, "pgsql-admin(at)lists(dot)postgresql(dot)org" <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: PostgreSQL CHARACTER VARYING vs CHARACTER VARYING (Length)
Date: 2020-04-29 05:32:43
Message-ID: CAKFQuwaQ3Wxbqgs6es6Rh8NO9Ugn8VEUNMPjoErCX17a2wY51w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-hackers

On Tuesday, April 28, 2020, Rui DeSousa <rui(at)crazybean(dot)net> wrote:
>
> I would agree with you that "text and a constraint" is a lot better than
> just text; and would be functionally equivalent to varchar(n).
>

Close enough...

It does requires the reader to look into each constraint to know what’s
> going on.
>

And “n” is so informative...please. The name of the field tells me most
of what I care about, the “n” and/or constraint are fluff.

> Also, when porting the schema to a different database engine and the
> create table statement fails because it’s too wide and doesn’t fit on a
> page; the end result is having to go back and redefine the text fields as
> varchar(n)/char(n) anyway.
>

Not something I’m concerned about and if that other db doesn’t have
something like TOAST it seems like an undesirable target.

David J.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Rui DeSousa 2020-04-29 05:51:05 Re: PostgreSQL CHARACTER VARYING vs CHARACTER VARYING (Length)
Previous Message Tim Cross 2020-04-29 05:30:03 Re: PostgreSQL CHARACTER VARYING vs CHARACTER VARYING (Length)

Browse pgsql-hackers by date

  From Date Subject
Next Message Mahendra Singh Thalor 2020-04-29 05:45:36 Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions
Previous Message Tim Cross 2020-04-29 05:30:03 Re: PostgreSQL CHARACTER VARYING vs CHARACTER VARYING (Length)