In article <4382953B.4080905@stripped>,
Ferindo Middleton Jr <fmiddleton@stripped> 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?