In article <[EMAIL PROTECTED]>,
Ferindo Middleton Jr <[EMAIL PROTECTED]> writes:

> I have this SQL statement:
> CREATE TABLE rooms (
>                          id                SERIAL,
>                          room_name       TEXT UNIQUE,
>                          location      TEXT,
>                          last_updated  TIMESTAMP DEFAULT
> CURRENT_TIMESTAMP NOT NULL,
>                          last_user_updated    TEXT,
>              PRIMARY KEY(id)
> );

> When I run this I get the following error:
> ERROR 1170 (42000): BLOB/TEXT column 'room_name' used in key
> specification without a key length

MySQL can index only the first N chars of a BLOB or TEXT column; you
must supply the value of N.

> I'm more used to PostgreSQL and when I run this command there, I don't
> get this error message.

Even in PostgreSQL it's not always beneficial to put a long bytea
column into an index.  Can't you use a surrogate key?


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to