| From: | Andres Freund <andres(at)anarazel(dot)de> |
|---|---|
| To: | Peter Eisentraut <peter(at)eisentraut(dot)org>, pj(at)illuminatedcomputing(dot)com |
| Cc: | pgsql-hackers(at)postgresql(dot)org |
| Subject: | Re: Temporal fkey bugs |
| Date: | 2026-09-11 19:23:16 |
| Message-ID: | kcyaok346iwocfdourf2oojgtz7ggxmh2ugis7qqhggs4qfzc2@cu6pkox4rfwp |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi,
On 2026-09-11 14:51:52 -0400, Andres Freund wrote:
> While looking at FOR PORTION OF (see [1]), some AI tool noted that FPO can
> lead to issues with temporal foreign keys. I don't think the issues were
> really related to FPO, hence this new thread.
Grmpf, it also found some stuff in temporal keys:
- RelationFindReplTupleByIndex() skips equality checks for
primary-key/replica-identity indexes without xs_recheck
Temporal keys can use GiST, where a returned candidate need not be an exact
match. That can lead to modifying the wrong row, which is ... not good.
- The outer constraint scan honors NULLS NOT DISTINCT, but
index_recheck_constraint() unconditionally treats an existing NULL as
disproving a conflict. That is a problem when needing a recheck.
See constraint.sql.
Greetings,
Andres Freund
| Attachment | Content-Type | Size |
|---|---|---|
| constraint.sql | application/sql | 990 bytes |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Haibo Yan | 2026-09-11 19:29:00 | Re: Init connection time grows quadratically |
| Previous Message | Andres Freund | 2026-09-11 18:51:52 | Temporal fkey bugs |