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 1ndCet-0000kQ-K9 for pgsql-general@arkaria.postgresql.org; Sat, 09 Apr 2022 15:05:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ndCes-00084p-Ge for pgsql-general@arkaria.postgresql.org; Sat, 09 Apr 2022 15:05:50 +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 1ndCes-00084g-6Q for pgsql-general@lists.postgresql.org; Sat, 09 Apr 2022 15:05:50 +0000 Received: from mail-oi1-x22c.google.com ([2607:f8b0:4864:20::22c]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ndCep-0005rS-1j for pgsql-general@lists.postgresql.org; Sat, 09 Apr 2022 15:05:48 +0000 Received: by mail-oi1-x22c.google.com with SMTP id t21so11674908oie.11 for ; Sat, 09 Apr 2022 08:05:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=vTzmuKlawlVu8sEyi5vfi4M8KzR5dRU4flQWfcuSpWg=; b=FRz4VXoh/8lO/S/MJ5vkfBm+lOmg3+F2kaCaP2hv8KmAETD1bmfwztqgzST3gu6yRF adkBg8sO/2J4OxAB/cP31yCOpwnbkz+RIvnC8mUbvy97xDBghYCIfHqmKmDzO+MLXfu6 qvO4kIdCy4Uf9bL0CbwSaex1E2tV79qaX5MyMSGLSt3x6la7Wwqz7ZpHTII+QAJNj0xy hO/RaI4zsPCdspEirrPHOmzQPkY/iKIbjN4AkpxrNFKjvLkUfXi7PBvoXbX1bGzq/Pc/ xHHmIHYmT+52a3r7GMnwYk1nRDIdlJcA5rIVEhY2PEtcnJK8nBjn4FtEkv0Wcn3h9B6h hnGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=vTzmuKlawlVu8sEyi5vfi4M8KzR5dRU4flQWfcuSpWg=; b=ZeYB2TUqo081P6TWA0n3tpSEyevLVsGqq/Hw7bIrkf3aDshI/roKN/JNGigjVOGKW3 884DndxeUQIXYqUbXRtcMh9astPpSe6zkd6wBY3Let6/+iazAthNDqQ0h0eB60Nr0T/Y 2VQpyS1B7zL6MKg9MRrtgcZNs9Qq7ar+zeOyYwJsE2qm+fG1Wu7ZzRTGgMaIm3ALUog5 KEOn550w6YB8yKx2Ago7jKuONjknL3Gt7IDdaJpZECbNHBdViY/Jk/18bP3IJL9edGuU UvNDrzsXaNno99DjosZc7CfqwNctnZtevfI7bXiDBhPLbNH9yxUg+89fbOtbuC1r0GXy 93pw== X-Gm-Message-State: AOAM533J6EqH+56LYgeQJHUfTFLhhdn0zVGyC0nn6FPQGNJXjCgmaQdo la5GPXLc6nGeaGVG4Gm0YKH7xCXHPbw= X-Google-Smtp-Source: ABdhPJxxfFPq6TBom2EliSQlmD0Qh2bQnwsR0n3IK+EEVgVh53wMy/Am9KLNSbjPCBwv6v9IxeTMRA== X-Received: by 2002:a05:6808:1710:b0:2f9:6c36:70cd with SMTP id bc16-20020a056808171000b002f96c3670cdmr1848296oib.299.1649516745925; Sat, 09 Apr 2022 08:05:45 -0700 (PDT) Received: from [192.168.88.10] (ip68-11-68-85.no.no.cox.net. [68.11.68.85]) by smtp.googlemail.com with ESMTPSA id o2-20020a05687072c200b000d9ae3e1fabsm9805120oak.12.2022.04.09.08.05.45 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 09 Apr 2022 08:05:45 -0700 (PDT) Message-ID: <698dc608-aa1d-9763-714a-b1fe278534d6@gmail.com> Date: Sat, 9 Apr 2022 10:05:44 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: Constraint ordering Content-Language: en-US To: "pgsql-general@lists.postgresql.org" References: <77C5CA14-9BB6-42A8-B700-4CDE2D69066E@easesoftware.com> From: Ron In-Reply-To: <77C5CA14-9BB6-42A8-B700-4CDE2D69066E@easesoftware.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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.