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 1lGXSg-0002XW-5J for pgsql-bugs@arkaria.postgresql.org; Mon, 01 Mar 2021 01:35:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lGXSe-0002cY-Aq for pgsql-bugs@arkaria.postgresql.org; Mon, 01 Mar 2021 01:35:00 +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 1lGXSe-0002cR-4Y for pgsql-bugs@lists.postgresql.org; Mon, 01 Mar 2021 01:35:00 +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 1lGXSb-0005lU-M2 for pgsql-bugs@lists.postgresql.org; Mon, 01 Mar 2021 01:34:58 +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 1211YtLM663314; Sun, 28 Feb 2021 20:34:55 -0500 From: Tom Lane To: "David G. Johnston" cc: "goodluck.deep989@gmail.com" , "pgsql-bugs@lists.postgresql.org" Subject: Re: Bug : Did't show Constaint violation error In-reply-to: References: <4F2A147E-89DD-417B-8AA9-FD37AC2B4D6E@hxcore.ol> Comments: In-reply-to "David G. Johnston" message dated "Sun, 28 Feb 2021 16:05:42 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <663312.1614562495.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Sun, 28 Feb 2021 20:34:55 -0500 Message-ID: <663313.1614562495@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk "David G. Johnston" writes: > On Sunday, February 28, 2021, wrote: >> I think it should not allow to add this constraint if we have the column >> char size is less than the size of values on which we are putting the >> constraints. > It doesn’t seem worth the effort. Even more to the point, it'd probably be a violation of the SQL standard. The standard does not prohibit unsatisfiable constraints. (IIRC, people actually use such things, too, if they want an empty table to stay empty.) regards, tom lane