Обсуждение: constraint trigger

Поиск
Список
Период
Сортировка

constraint trigger

От
"Komaravolu, Satya"
Дата:
Hi
 
    I'm running into the following error when i create a CONSTRAINT TRIGGER.
 
   

 NOTICE:  ignoring incomplete trigger group for constraint "<unnamed>" FOREIGN KEY cd_card(tender) REFERENCES cd_tender(id)
DETAIL:  Found referenced table's DELETE trigger.

for the following statement

CREATE CONSTRAINT TRIGGER "<unnamed>" AFTER DELETE ON "cd_tender"  NOT DEFERRABLE INITIALLY IMMEDIATE FOR EACH ROW EXECUTE PROCEDURE "RI_FKey_noaction_del" ('<unnamed>', 'cd_card', 'cd_tender', 'UNSPECIFIED', 'tender', 'id');

could you please tell how to solve this. Also can you tell what the function arguments mean. I know so much that these parameters anre table and column

names. but not sure what "<unnamed>" and 'UNSPECIFIED' stand for. Also i notice that if i remove "<unnamed>" and 'UNSPECIFIED' the trigger gets created but not sure of behavior. it is a combination of RI_FKey_noaction_del and "<unnamed>" and 'UNSPECIFIED'  is causing the problem.

 

thanks

satya

Please be advised that this email may contain confidential information.
If you are not the intended recipient, please do not read, copy or
re-transmit this email. If you have received this email in error,
please notify us by email by replying to the sender and by telephone
(call us collect at +1 202-828-0850) and delete this message and any
attachments. Thank you in advance for your cooperation and assistance.

In addition, Danaher and its subsidiaries disclaim that the content of
this email constitutes an offer to enter into, or the acceptance of,
any
contract or agreement or any amendment thereto; provided that the
foregoing disclaimer does not invalidate the binding effect of any
digital or other electronic reproduction of a manual signature that is
included in any attachment to this email.

Re: constraint trigger

От
Tom Lane
Дата:
"Komaravolu, Satya" <satya.komaravolu@gilbarco.com> writes:
>     I'm running into the following error when i create a CONSTRAINT
> TRIGGER.

>  NOTICE:  ignoring incomplete trigger group for constraint "<unnamed>"
> FOREIGN KEY cd_card(tender) REFERENCES cd_tender(id)
> DETAIL:  Found referenced table's DELETE trigger.

That is not an "error".

> CREATE CONSTRAINT TRIGGER "<unnamed>" AFTER DELETE ON "cd_tender"  NOT
> DEFERRABLE INITIALLY IMMEDIATE FOR EACH ROW EXECUTE PROCEDURE
> "RI_FKey_noaction_del" ('<unnamed>', 'cd_card', 'cd_tender',
> 'UNSPECIFIED', 'tender', 'id');

This is one out of a group of three related triggers that ancient
Postgres versions used to use to implement foreign key constraints.
(Actually, modern versions still use related triggers, but they're
a bit better hidden now --- you shouldn't see them in pg_dump output,
for sure.)

The message is telling you that the system is waiting for the other two
matching trigger definitions so that it will have enough information to
create a regular FOREIGN KEY constraint.

If you are doing this as part of loading an old dump file, just ignore
the notice and keep going; everything should be fine.  If you are doing
this manually, maybe you had better explain why.

            regards, tom lane

Re: constraint trigger

От
Tom Lane
Дата:
"Komaravolu, Satya" <satya.komaravolu@gilbarco.com> writes:
>   The SQL file is failing on the following error. I gave you that
> message as it was the first one for the list
>   of CONSTRAINT TRIGGER statements.

>  NOTICE:  converting trigger group into constraint "<unnamed>" FOREIGN
> KEY jn_fuel(transaction_id) REFERENCES jn_transaction_header(record_id)
> DETAIL:  Found referencing table's trigger.
> psql:cfn4.dbinstall.sql:2585: ERROR:  there is no unique constraint
> matching given keys for referenced table "jn_transaction_header"

Hmm, is it possible that the dump file creates a unique or pkey
constraint on jn_transaction_header(record_id) further down?

What is the dump file from, anyway (which PG version exactly)?
How old is the foreign key constraint --- it could have been
propagated through several PG versions, because we didn't start
trying to clean up these obsolete trigger declarations until recently.

            regards, tom lane