Subject Re: [firebird-support] Alter table error
Author Martijn Tonies

> At 09:31 AM 17/08/2004 +0200, Mr Bamsemums wrote:
> >Actually, 31 characters for object names, less for constraint names.
> I've heard this rumour about short contraint name limits too, but I can't
> get Firebird to reject a 31-character constraint name.

Hmm - that's strange... According to the InterBase documentation
(assuming nothing changed for Firebird in this regard):
When an applications programmer or end user creates a database object or

to it by name, case is unimportant. The following limitations on naming

objects must be observed:

. Start each name with an alphabetic character (A-Z or a-z).

. Restrict object names to 67 characters, including dollar signs ($),

(_), 0 to 9, A to Z, and a to z. Some objects, such as constraint names, are

restricted to 27 bytes in length.

. Keep object names unique. In all cases, objects of the same type-all
tables, for

example-must be unique. In most cases, object names must also be unique

within the database.

Note: I think the "27" should be removed now as they now
accept 67 length names. Nevertheless, it used to say "31"
and "27" for constraint names.

> Try this in your horriblest database:
> create table table1 (
> id integer not null primary key,
> data varchar(30));
> commit;
> create table table2 (
> id integer not null primary key,
> data varchar(30),
> fid integer,
> constraint fk_t111111111111111111111111111 foreign key (fid)
> references table1);
> commit;
> alter table table2
> drop constraint fk_t111111111111111111111111111 ;
> commit;
> alter table table2
> add constraint fk_t111111111111111111111111111 foreign key (fid)
> references table1 ;
> commit;
> Not a squawk.

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Upscene Productions