Subject Fb 1.5.4 - RDB$RELATION_FIELDS not in RDB$RELATIONS
Author Svein Erling Tysvær
On one of our databases,

SELECT rf.RDB$RELATION_NAME, rf.RDB$FIELD_NAME
FROM RDB$RELATION_FIELDS rf
WHERE NOT EXISTS(SELECT * FROM RDB$RELATIONS r
WHERE r.RDB$RELATION_NAME = rf.RDB$RELATION_NAME)

returns two records. These two records were the fields of a table referred to from a procedure that we recently "renamed" (we don't remember exactly how things were done, but we used ordinary DDL through IB_SQL to drop and recreate the table/procedure, no fiddling with system tables).

Having these two records in RDB$RELATION_FIELDS makes DB Workbench complain loudly, refusing to show the table and view names of existing tables/views in the database (hint: a warning is more pleasant than an error, Martijn).

Now, two questions:

1) How come this table could be dropped without dropping its fields?
2) Is it safe to just delete the two records in question from RDB$RELATION_FIELDS or is there a safer way to fix the problem?

Set


[Non-text portions of this message have been removed]