Re: [SQL] CHAR or VARCHAR

2001-03-25 Thread Josh Berkus
Folks - > On other DBMSes there could be a difference, especially if the DBMS > has > performance problems with variable-length fields. For example ... MS-SQL Server 7.0 requires 2 extra bytes to store the length of a string for VARCHAR. Thus, CHAR(3) takes 3 bytes (roughly) and VARCHAR(3) take

Re: [SQL] CHAR or VARCHAR

2001-03-25 Thread Tom Lane
"Peter J. Schoenster" <[EMAIL PROTECTED]> writes: > On 22 Mar 2001, at 10:05, Tom Lane wrote: >> There is *no* performance advantage of CHAR(n) over VARCHAR(n). > I wonder if this question of char/varchar is postgresql specific or > rdbms in general. It's definitely RDBMS-specific. My comment

Re: [SQL] CHAR or VARCHAR

2001-03-25 Thread Peter J. Schoenster
On 22 Mar 2001, at 10:05, Tom Lane wrote: > There is *no* performance advantage of CHAR(n) over VARCHAR(n). > If anything, there is a performance lossage due to extra disk I/O > (because all those padding blanks take space, and time to read). > > My advice is to use CHAR(n) when that semanticall

Re: [SQL] CHAR or VARCHAR

2001-03-21 Thread Peter J. Schoenster
On 21 Mar 2001, at 18:58, Martin A. Marques wrote: > two questions. > When should I use one, and when the other? > Which is the limit on CHAR(n) and VARCHAR(n)? Okay, here is my more "let's get this thing working" as opposed to "after dedicated study of the matter" opinion (which I hope some d