| From: | Rui DeSousa <rui(dot)desousa(at)icloud(dot)com> |
|---|---|
| To: | M Sarwar <sarwarmd02(at)outlook(dot)com> |
| Cc: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, "wolters(dot)k(at)web(dot)de" <wolters(dot)k(at)web(dot)de>, "pgsql-admin(at)lists(dot)postgresql(dot)org" <pgsql-admin(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: AFTER INSERT trigger INSERT into another table-B are ignoring Table-B constraints |
| Date: | 2024-05-23 22:15:59 |
| Message-ID: | 93EDD0BC-830E-4EE6-95FD-D41F689DD7EF@icloud.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-admin |
> On May 23, 2024, at 4:30 PM, M Sarwar <sarwarmd02(at)outlook(dot)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?
| From | Date | Subject | |
|---|---|---|---|
| Next Message | nikhil raj | 2024-05-23 22:52:27 | Postgres Service active with errors |
| Previous Message | M Sarwar | 2024-05-23 20:30:51 | Re: AFTER INSERT trigger INSERT into another table-B are ignoring Table-B constraints |