Re: Primary Key...Is One Required?
Posted in 1999
Bonnie,
On Wed, 2 Jun 1999, Bonnie Annelin wrote:
> I have a question regarding primary keys for tables. Is it necessary to
> have a primary key for a table?
No.
> According to Informix Documentation,
> if a primary key does not exist for a table, a primary key is composed
> of all columns taken together. Does this mean that Informix
> automatically generates a primary key?
No.
> I do a database dump (dbschema)
> and do not see a primary key listed for my table. Also, I recently
> attended an Informix Class where the instructor said that Informix does
> not automatically generate a primary key. I'm now wondering whether
> or not I should create a serial record_num primary key for this table
> because if one is automatically generated out of every column (I have a
> large number of columns) and because primary keys are automatically
> indexed, this will be a very large/inefficient index.
>
> Thanks,
> Bonnie Annelin
>
Informix does not require primary keys. You may set these up if you require them
also informix does not automatically generate primary keys. Columns that make
up a primary key can not be NULL. My suggestion is leave the table(s) as they
are. Create indexes if and when required.
Stephen C Manga
Email: Stephen.Manga@dbgroup.co.nz
Stephen@quanta.co.nz