Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 414FA47591C for ; Tue, 16 Apr 2002 00:47:26 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id g3G4lCF09333; Tue, 16 Apr 2002 00:47:12 -0400 (EDT) To: "Josh Berkus" Cc: "jack" , pgsql-sql@postgresql.org Subject: Re: please advise on column data type In-reply-to: References: Comments: In-reply-to "Josh Berkus" message dated "Mon, 15 Apr 2002 19:51:11 -0700" Date: Tue, 16 Apr 2002 00:47:12 -0400 Message-ID: <9330.1018932432@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200204/201 X-Sequence-Number: 7465 "Josh Berkus" writes: > In some databases, yes. However, in PostgreSQL, there is no > performance difference between CHAR, VARCHAR, and TEXT. So use what's > appropriate for the data being stored. In fact, char() is probably *worse* than the other alternatives, at least for data that doesn't have a clearly defined length, because it forces blank-padding on you. I'd use char(N) for US postal abbreviations (state = char(2), etc) and not a lot else. If you have an *error checking* reason to use char(N), then use it. If you think you are getting a performance improvement, then you are far out in left field. regards, tom lane