Re: Unclear CHARACTER specification - Mailing list pgsql-docs

From Kevin Grittner
Subject Re: Unclear CHARACTER specification
Date
Msg-id 20130104201152.4830@gmx.com
Whole thread Raw
In response to Unclear CHARACTER specification  (Lyle <webmaster@cosmicperl.com>)
List 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


pgsql-docs by date:

Previous
From: "Sahagian, David"
Date:
Subject: doc page: ALTER VIEW
Next
From: Josh Kupershmidt
Date:
Subject: old testlo example code