Re: [gnome-db] Triggers support



On Mon, 2002-12-16 at 13:38, Vivien Malerba wrote:
> > > I know that within Postgres these two notions are implemented using
> > > triggers, but I don't know if it is the same for other DBMS. Maybe it is
> > > easier to have a schema request for triggers and another for foreign
> > > keys and referential integrity rules, may be not...
> > 
> > http://www.freebsddiary.org/postgresql-dropping-constraints.php describes some 
> > illegal schema access in 7.2. But the information for > 7.3 is interesting.
> > 
> > PostgreSQL rules, triggers and foreign keys should be considered different 
> > objects in libgda.
> 
> You mean they should be reported to the libgda user from different
> schema name; I agree with you. Could you propose some list output the
> libgda API would return when the list of triggers, foreign keys and
> rules.
> 
> Here is my idea about it:
> 
> Foreign keys:
> -------------
> returned columns are, for each foreign key:
> - foreign key identifier (FKID)
> - table1.field which is a foreign key
> - table2.field which is the primary key (for table2)
> - action on update
> - action on delete
> - other referential integrity attributes
> 
> This means for example that a foreign key composed of two fields will
> appear here as two lines with the same FKID.
> 
> Note: the primary key is obtained using the GDA_CONNECTION_SCHEMA_FIELDS
> schema query which, for any field, returns TRUE or FALSE depending on if
> the field is part of q primary key or not. The associated limitation is
> that libgda will not report correctly the primary keys if there are
> several different primary keys (composed or not).
> 
well, I think it was supposed to set the primary_key field to TRUE for
all fields that are a primary key or part of a primary key. Then, you
can easily know if the primary key is a unique field (only one field in
the model has the primary_key field set to TRUE) or a multiple fields
key.

For the foreign key output you propose, I think we should make sure we
allow querying the schema given a table name, so that you can easily
query the provider about it.

> Triggers and rules:
> -------------------
> I don't have any precise idea here...
> 
for triggers, see the comments in
http://bugzilla.gnome.org/show_bug.cgi?id=101121.

For rules, please add any comment to
http://bugzilla.gnome.org/show_bug.cgi?id=71089

cheers




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]