[EMAIL PROTECTED] wrote:
> >Jim Nasby <[EMAIL PROTECTED]> wrote on 02/08/2007 12:12:00 PM:

> > If you do end up back at using foreign keys, I suggest using either a 
> > smallint or "char"... the savings across the number of fields you're 
> > looking at would start to add up, especially if you start putting a 
> > decent number of rows in the table.
> 
> I ended up using Varchar(1). According to the help there is no speed 
> difference in the character types, on am I misunderstanding something? 

The "char" type (including quotes) is a very different animal from all
those character types the manual you quote is talking about.  "char" is
a single byte, while varchar(1) and all the rest are a single character,
meaning there can be multiple bytes in presence of a multibyte encoding;
so Postgres is forced to use a variable-length structure to store it.
"char" has no such requirement.  It's used in the system catalogs as a
"poor man's enum", for example in pg_class.relkind.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

Reply via email to