*
* 1999 Jan Wieck
*
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/ri_triggers.c,v 1.14 2000/04/12 17:15:51 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/ri_triggers.c,v 1.14.2.1 2000/09/23 21:15:26 tgl Exp $
*
* ----------
*/
*/
fk_rel = trigdata->tg_relation;
pk_rel = heap_openr(tgargs[RI_PK_RELNAME_ARGNO], NoLock);
+
+ if (pk_rel == NULL)
+ {
+ elog(ERROR, "RI constraint %s cannot find table %s",
+ tgargs[RI_CONSTRAINT_NAME_ARGNO], tgargs[RI_PK_RELNAME_ARGNO]);
+ }
+
if (TRIGGER_FIRED_BY_UPDATE(trigdata->tg_event))
{
old_row = trigdata->tg_trigtuple;
pk_rel = trigdata->tg_relation;
old_row = trigdata->tg_trigtuple;
+ if (fk_rel == NULL)
+ {
+ elog(ERROR, "RI constraint %s cannot find table %s",
+ tgargs[RI_CONSTRAINT_NAME_ARGNO], tgargs[RI_FK_RELNAME_ARGNO]);
+ }
+
switch (ri_DetermineMatchType(tgargs[RI_MATCH_TYPE_ARGNO]))
{
/* ----------
new_row = trigdata->tg_newtuple;
old_row = trigdata->tg_trigtuple;
+ if (fk_rel == NULL)
+ {
+ elog(ERROR, "RI constraint %s cannot find table %s",
+ tgargs[RI_CONSTRAINT_NAME_ARGNO], tgargs[RI_FK_RELNAME_ARGNO]);
+ }
+
switch (ri_DetermineMatchType(tgargs[RI_MATCH_TYPE_ARGNO]))
{
/* ----------
pk_rel = trigdata->tg_relation;
old_row = trigdata->tg_trigtuple;
+ if (fk_rel == NULL)
+ {
+ elog(ERROR, "RI constraint %s cannot find table %s",
+ tgargs[RI_CONSTRAINT_NAME_ARGNO], tgargs[RI_FK_RELNAME_ARGNO]);
+ }
+
switch (ri_DetermineMatchType(tgargs[RI_MATCH_TYPE_ARGNO]))
{
/* ----------
new_row = trigdata->tg_newtuple;
old_row = trigdata->tg_trigtuple;
+ if (fk_rel == NULL)
+ {
+ elog(ERROR, "RI constraint %s cannot find table %s",
+ tgargs[RI_CONSTRAINT_NAME_ARGNO], tgargs[RI_FK_RELNAME_ARGNO]);
+ }
+
switch (ri_DetermineMatchType(tgargs[RI_MATCH_TYPE_ARGNO]))
{
/* ----------
pk_rel = trigdata->tg_relation;
old_row = trigdata->tg_trigtuple;
+ if (fk_rel == NULL)
+ {
+ elog(ERROR, "RI constraint %s cannot find table %s",
+ tgargs[RI_CONSTRAINT_NAME_ARGNO], tgargs[RI_FK_RELNAME_ARGNO]);
+ }
+
switch (ri_DetermineMatchType(tgargs[RI_MATCH_TYPE_ARGNO]))
{
/* ----------
new_row = trigdata->tg_newtuple;
old_row = trigdata->tg_trigtuple;
+ if (fk_rel == NULL)
+ {
+ elog(ERROR, "RI constraint %s cannot find table %s",
+ tgargs[RI_CONSTRAINT_NAME_ARGNO], tgargs[RI_FK_RELNAME_ARGNO]);
+ }
+
switch (ri_DetermineMatchType(tgargs[RI_MATCH_TYPE_ARGNO]))
{
/* ----------
pk_rel = trigdata->tg_relation;
old_row = trigdata->tg_trigtuple;
+ if (fk_rel == NULL)
+ {
+ elog(ERROR, "RI constraint %s cannot find table %s",
+ tgargs[RI_CONSTRAINT_NAME_ARGNO], tgargs[RI_FK_RELNAME_ARGNO]);
+ }
+
switch (ri_DetermineMatchType(tgargs[RI_MATCH_TYPE_ARGNO]))
{
/* ----------
old_row = trigdata->tg_trigtuple;
match_type = ri_DetermineMatchType(tgargs[RI_MATCH_TYPE_ARGNO]);
+ if (fk_rel == NULL)
+ {
+ elog(ERROR, "RI constraint %s cannot find table %s",
+ tgargs[RI_CONSTRAINT_NAME_ARGNO], tgargs[RI_FK_RELNAME_ARGNO]);
+ }
+
switch (match_type)
{
/* ----------
pk_rel = trigdata->tg_relation;
old_row = trigdata->tg_trigtuple;
+ if (fk_rel == NULL)
+ {
+ elog(ERROR, "RI constraint %s cannot find table %s",
+ tgargs[RI_CONSTRAINT_NAME_ARGNO], tgargs[RI_FK_RELNAME_ARGNO]);
+ }
+
switch (ri_DetermineMatchType(tgargs[RI_MATCH_TYPE_ARGNO]))
{
/* ----------
pk_rel = trigdata->tg_relation;
new_row = trigdata->tg_newtuple;
old_row = trigdata->tg_trigtuple;
-
match_type = ri_DetermineMatchType(tgargs[RI_MATCH_TYPE_ARGNO]);
+ if (fk_rel == NULL)
+ {
+ elog(ERROR, "RI constraint %s cannot find table %s",
+ tgargs[RI_CONSTRAINT_NAME_ARGNO], tgargs[RI_FK_RELNAME_ARGNO]);
+ }
+
switch (match_type)
{
/* ----------
new_row = trigdata->tg_newtuple;
old_row = trigdata->tg_trigtuple;
+ if (fk_rel == NULL)
+ {
+ elog(ERROR, "RI constraint %s cannot find table %s",
+ tgargs[RI_CONSTRAINT_NAME_ARGNO], tgargs[RI_FK_RELNAME_ARGNO]);
+ }
+
switch (ri_DetermineMatchType(tgargs[RI_MATCH_TYPE_ARGNO]))
{
/* ----------