From: Tom Lane <tgl@sss.pgh.pa.us>
To: byrnejb@harte-lyne.ca
Cc: pgsql-general@lists.postgresql.org
Subject: Re: character datatype explaination sought
Date: Thu, 15 Oct 2020 10:19:53 -0400
Message-ID: <3679884.1602771593@sss.pgh.pa.us> (raw)
In-Reply-To: <2e5ca4ddea12c49971e85d48d87631ab.squirrel@webmail.harte-lyne.ca>
References: <2e5ca4ddea12c49971e85d48d87631ab.squirrel@webmail.harte-lyne.ca>
"James B. Byrne" <byrnejb@harte-lyne.ca> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, byrnejb@harte-lyne.ca
Subject: Re: character datatype explaination sought
In-Reply-To: <3679884.1602771593@sss.pgh.pa.us>
References: <2e5ca4ddea12c49971e85d48d87631ab.squirrel@webmail.harte-lyne.ca> <3679884.1602771593@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox