http://www.mysql.com/doc/S/i/Silent_column_changes.html

second item, quoted here:

If any column in a table has a variable length, the entire row is
variable-length as a result. Therefore, if a table contains any
variable-length columns (VARCHAR, TEXT, or BLOB), all CHAR columns longer
than three characters are changed to VARCHAR columns. This doesn't affect
how you use the columns in any way; in MySQL, VARCHAR is just a different
way to store characters. MySQL performs this conversion because it saves
space and makes table operations faster. See section 8 MySQL Table Types.

----- Original Message -----
From: "Alec Solway" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, May 07, 2001 2:38 PM
Subject: char -> varchar ?


> Hi,
>
> In various create table statements char columns are converted to varchar..
> I was wondering why this was happening. Here's an example:
>
> CREATE TABLE realtors(name VARCHAR(255) not null, address VARCHAR(255) not
> null, city VARCHAR(255) not null, state CHAR(2) not null, country CHAR(2)
> not null, zip CHAR(5) not null, phone VARCHAR(50) not null, cell
> VARCHAR(50) not null, fax VARCHAR(50) not null, nvio VARCHAR(25) not null,
> estlead CHAR(5) not null, servicearea VARCHAR(255) not null);
> Query OK, 0 rows affected (0.11 sec)
>
> Here, zip and estlead have been converted to varchar(5).
>
>
> Thanks.
> Alec
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to