Re: Unclear CHARACTER specification

From: "Kevin Grittner" <kgrittn(at)mail(dot)com>
To: "Lyle" <webmaster(at)cosmicperl(dot)com>,pgsql-docs(at)postgresql(dot)org
Subject: Re: Unclear CHARACTER specification
Date: 2013-01-04 20:11:52
Message-ID: 20130104201152.4830@gmx.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

Lyle wrote:

> Is there other documentation available that covers this?

You might want to read this page:

http://www.postgresql.org/docs/9.2/static/storage-toast.html

Note that there is seldom a good reason to use char(n) in
PostgreSQL for any value of n. As the page you cited mentions,
"While character(n) has performance advantages in some other
database systems, there is no such advantage in PostgreSQL; in fact
character(n) is usually the slowest of the three because of its
additional storage costs. In most situations text or character
varying should be used instead."

Don't try to micro-optimize by breaking what is logically a larger
string into 126 character pieces; that will defeat copression, take
more space to store, and add processing overhead. In other words,
such an attempt will almost certainly backfire.

-Kevin

Browse pgsql-docs by date

  From Date Subject
Next Message Josh Kupershmidt 2013-01-05 02:27:14 old testlo example code
Previous Message Sahagian, David 2013-01-02 16:58:24 doc page: ALTER VIEW