Re: character datatype explaination sought

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: byrnejb(at)harte-lyne(dot)ca
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: character datatype explaination sought
Date: 2020-10-15 14:19:53
Message-ID: 3679884.1602771593@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"James B. Byrne" <byrnejb(at)harte-lyne(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Laurenz Albe 2020-10-15 14:19:59 Re: character datatype explaination sought
Previous Message James B. Byrne 2020-10-15 14:07:22 character datatype explaination sought