Re: varchar vs. text - Mailing list pgsql-general

From Ron Johnson
Subject Re: varchar vs. text
Date
Msg-id 1063880717.11739.1590.camel@haggis
Whole thread Raw
In response to varchar vs. text  (Michael Garriss <mgarriss@earthlink.net>)
List pgsql-general
On Wed, 2003-09-17 at 22:59, Michael Garriss wrote:
> I curious about the benefits of a varchar over text.  Is it speed,
> size?  If so, how much speed, size?  Is a varchar(64) and a text with 64
> chars the same size?  I'm inclined to make all my varchars into text so
> I don't have to worry about inserting something to big.

An analyst would say that "correctness" is a reason for specifying
a max length.  For example, in t_names, I could stick "War and Peace"
into first_name, but, obviously, that's not "correct".

CREATE TABLE t_names (
first_name   TEXT,
last_name    TEXT );

--
-----------------------------------------------------------------
Ron Johnson, Jr. ron.l.johnson@cox.net
Jefferson, LA USA

"(Women are) like compilers. They take simple statements and
make them into big productions."
Pitr Dubovitch


pgsql-general by date:

Previous
From: Ron Johnson
Date:
Subject: Re: Why does adding SUM and GROUP BY destroy performance?
Next
From: ramkumarm@npd.hcltech.com (Ramkumar)
Date:
Subject: Problem in Function returning Cursors - Postgres Sql 7.2