Received: from math.unl.edu.ar (math.unl.edu.ar [170.210.15.78]) by mail.postgresql.org (8.11.3/8.11.1) with ESMTP id f2MBBLt36552 for ; Thu, 22 Mar 2001 06:11:27 -0500 (EST) (envelope-from martin@math.unl.edu.ar) Received: from localhost (localhost [[UNIX: localhost]]) by math.unl.edu.ar (8.9.3/8.9.3) id IAA07177; Thu, 22 Mar 2001 08:05:19 -0300 Content-Type: text/plain; charset="iso-8859-1" From: "Martin A. Marques" To: Stephan Szabo Subject: Re: CHAR or VARCHAR Date: Thu, 22 Mar 2001 08:05:19 -0300 X-Mailer: KMail [version 1.2] Cc: pgsql-sql@postgresql.org References: In-Reply-To: MIME-Version: 1.0 Message-Id: <01032208051900.07158@math.unl.edu.ar> Content-Transfer-Encoding: 8bit X-Archive-Number: 200103/437 X-Sequence-Number: 2105 El Mié 21 Mar 2001 22:21, Stephan Szabo escribió: > On Wed, 21 Mar 2001, Martin A. Marques wrote: > > two questions. > > When should I use one, and when the other? > > Almost always varchar() unless you know that your > input is of constant size. How does performace look when doing lots of searches on a VARCHAR column with respect of a CHAR column? That is my main concern. I mean, what if I have to do lots of queries with LIKEs on that column? > > Which is the limit on CHAR(n) and VARCHAR(n)? > > In 7.0.x and earlier, there's an row limit > for all values in a row which defaulted to 8k (just > below technically i believe) but could be raised > at compile time to 32k. > All fields in the row had to fit in that 8-32k. > So you'd have to figure the limit out based on the > other fields. > > In 7.1(currently in beta), long values can be stored > outside that so you have more of a number of columns > limit rather than a per value limit. Technically, > it's probably still not a great idea to be sticking > megs in there for performance reasons. I can't believe that there is no limit. You mean that I put this: VARCHAR(1000000000000000000000000000000000) ? Saludos... :-) -- System Administration: It's a dirty job, but someone told me I had to do it. ----------------------------------------------------------------- Martín Marqués email: martin@math.unl.edu.ar Santa Fe - Argentina http://math.unl.edu.ar/~martin/ Administrador de sistemas en math.unl.edu.ar -----------------------------------------------------------------