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 1kT46s-0002ol-Cg for pgsql-general@arkaria.postgresql.org; Thu, 15 Oct 2020 14:20: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 1kT46r-0004dD-BH for pgsql-general@arkaria.postgresql.org; Thu, 15 Oct 2020 14:20:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kT46r-0004cy-41 for pgsql-general@lists.postgresql.org; Thu, 15 Oct 2020 14:20:01 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kT46o-0004Ut-Tj for pgsql-general@lists.postgresql.org; Thu, 15 Oct 2020 14:20:00 +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 09FEJrBx3679885; Thu, 15 Oct 2020 10:19:53 -0400 From: Tom Lane To: byrnejb@harte-lyne.ca cc: pgsql-general@lists.postgresql.org Subject: Re: character datatype explaination sought In-reply-to: <2e5ca4ddea12c49971e85d48d87631ab.squirrel@webmail.harte-lyne.ca> References: <2e5ca4ddea12c49971e85d48d87631ab.squirrel@webmail.harte-lyne.ca> Comments: In-reply-to "James B. Byrne" message dated "Thu, 15 Oct 2020 10:07:22 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3679883.1602771593.1@sss.pgh.pa.us> Date: Thu, 15 Oct 2020 10:19:53 -0400 Message-ID: <3679884.1602771593@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk "James B. Byrne" writes: > I am testing Idempiere and have run across this in an example: > character(1) DEFAULT 'Y'::bpchar NOT NULL, > How does this differ from > character(1) DEFAULT 'Y' NOT NULL, It doesn't. The former is just written with an explicit cast, which the latter lacks, but the end result will be the same because the parser will coerce the DEFAULT expression to the column's type anyway. (It helps to know that for reasons lost in the depths of time, Postgres' internal name for the char(N) type is "bpchar".) regards, tom lane