Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ndCh6-0000sP-1q for pgsql-general@arkaria.postgresql.org; Sat, 09 Apr 2022 15:08:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ndCh4-0004Eg-JG for pgsql-general@arkaria.postgresql.org; Sat, 09 Apr 2022 15:08:06 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ndCh4-0004EW-98 for pgsql-general@lists.postgresql.org; Sat, 09 Apr 2022 15:08:06 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ndCgx-0005sv-VU for pgsql-general@lists.postgresql.org; Sat, 09 Apr 2022 15:08:05 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 239F7Ho94108561; Sat, 9 Apr 2022 11:07:17 -0400 From: Tom Lane To: "David G. Johnston" cc: Perry Smith , "pgsql-general@lists.postgresql.org" Subject: Re: Constraint ordering In-reply-to: References: <77C5CA14-9BB6-42A8-B700-4CDE2D69066E@easesoftware.com> Comments: In-reply-to "David G. Johnston" message dated "Sat, 09 Apr 2022 08:01:25 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4108559.1649516837.1@sss.pgh.pa.us> Date: Sat, 09 Apr 2022 11:07:17 -0400 Message-ID: <4108560.1649516837@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David G. Johnston" writes: > On Sat, Apr 9, 2022 at 7:43 AM Perry Smith wrote: >> All that to ask: is there a predictable ordering of constraints? > I'm not aware of any documentation describing constraint evaluation order. IIRC, triggers are specified to fire in name order. Uniqueness constraints are not enforced by triggers though; I wouldn't care to rely on the order in which those are checked. regards, tom lane