Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hj2ze-0000sS-Vm for pgsql-general@arkaria.postgresql.org; Thu, 04 Jul 2019 14:45:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hj2zd-0000zw-A5 for pgsql-general@arkaria.postgresql.org; Thu, 04 Jul 2019 14:45:49 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hj2zc-0000zp-Te for pgsql-general@lists.postgresql.org; Thu, 04 Jul 2019 14:45:49 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hj2z9-0001tN-8s for pgsql-general@lists.postgresql.org; Thu, 04 Jul 2019 14:45:47 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x64EjHi3029035; Thu, 4 Jul 2019 10:45:17 -0400 From: Tom Lane To: Dirk Mika cc: "pgsql-general@lists.postgresql.org" Subject: Re: Expression of check constraint In-reply-to: References: Comments: In-reply-to Dirk Mika message dated "Thu, 04 Jul 2019 05:58:56 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <29033.1562251517.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 04 Jul 2019 10:45:17 -0400 Message-ID: <29034.1562251517@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Dirk Mika writes: > 3. The column ratified is of type character varying(1). Why is it ca= sted to text? Type varchar in Postgres is a poor stepchild without any operators of its own. Text is the "native" string type and any comparison etc will require casting varchar to text first. It happens that the expression decompilation code will show you those implicit casts explicitly, but they don't really mean much. regards, tom lane