Subject Re: [firebird-support] What is better? use integrity referencial or triggers?
Author Martijn Tonies
Hi,

> for the check of the primary key

A Primary Key constraint.

>, and the foreign key?, what is

A Foreign Key constraint.

> better?, declare it trought constraints?, or do trought declare
> triggers that do the job?.

No, I would throw triggers out of the window any day for this.
http://www.cvalde.net/document/declaRefIntegVsTrig.htm

Any optimizer/index related problems decreased since Fb1.5...

> I mean, here exist a constraint primary key, but what if i define a
> index unique?, what is better?

Internally, Firebird will already create a unique index for your
constraint. However, you cannot create a FK that's "pointing"
to a unique index, only to PK and Unique constraints.

> or.. if i have a foreign key? constraint?, with a constraint i can't
> specify the cardinality of the relation.

?

> the only way that i can check that is programing with triggers.

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com