From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Constraint ordering
Date: Sat, 9 Apr 2022 10:05:44 -0500
Message-ID: <698dc608-aa1d-9763-714a-b1fe278534d6@gmail.com> (raw)
In-Reply-To: <77C5CA14-9BB6-42A8-B700-4CDE2D69066E@easesoftware.com>
References: <77C5CA14-9BB6-42A8-B700-4CDE2D69066E@easesoftware.com>
On 4/9/22 09:42, Perry Smith wrote:
> I think (hope) I’ve made a bad assumption. I have my DB with one table with two constraint on new entries. The “first” is for the parent and basename be unique. The “second” is that the devno and inode are unique if it is a directory.
>
> When I was doing my early testing, the parent+basename constraint would fire first if it needed to. Now that I’m doing a longer test run, the second constraint is firing at a time that I wasn’t expecting. I’m debugging but it takes time to hit this again.
>
> My assumption was if the error reported back that the “second" constraint failed that the “first” constraint passed. But I bet that isn’t a valid assumption at all.
>
> All that to ask: is there a predictable ordering of constraints?
If this would be a problem, then make the constraints deferred (until commit).
--
Angular momentum makes the world go 'round.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: ronljohnsonjr@gmail.com
Subject: Re: Constraint ordering
In-Reply-To: <698dc608-aa1d-9763-714a-b1fe278534d6@gmail.com>
References: <77C5CA14-9BB6-42A8-B700-4CDE2D69066E@easesoftware.com> <698dc608-aa1d-9763-714a-b1fe278534d6@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox