Re: AFTER INSERT trigger INSERT into another table-B are ignoring Table-B constraints - Mailing list pgsql-admin

From Rui DeSousa
Subject Re: AFTER INSERT trigger INSERT into another table-B are ignoring Table-B constraints
Date
Msg-id 93EDD0BC-830E-4EE6-95FD-D41F689DD7EF@icloud.com
Whole thread Raw
In response to Re: AFTER INSERT trigger INSERT into another table-B are ignoring Table-B constraints  (M Sarwar <sarwarmd02@outlook.com>)
List pgsql-admin

On May 23, 2024, at 4:30 PM, M Sarwar <sarwarmd02@outlook.com> wrote:

Constraints are working as expected when I am working the table-2 directly. 
In my case, Table-2 needs to get INSERTed only when table-1 has INSERTs. Table-1 is working fine. Table-2 is also working fine when I am directly working in table-2.
But when I Table-2 needs to have INSERTs based on the trigger invocation of Table-1, Table-2 is applying constraints which is causing issues.

CONSTRAINT cons_unique_for_concatenated_view UNIQUE (start_time_numeric, stop_time_numeric, test_action, part_type, fixture_id, run_id, auxid1_build_id, auxid2_asic_id, serial_number, part_pf)

So the constraint above is not being honored? What are the duplicate records? Is this a view that you’re seeing the duplicate records in or a table?

I was under the impression that NULLs where in play here.  Is that not the case?

pgsql-admin by date:

Previous
From: M Sarwar
Date:
Subject: Re: AFTER INSERT trigger INSERT into another table-B are ignoring Table-B constraints
Next
From: nikhil raj
Date:
Subject: Postgres Service active with errors