Re: character datatype explaination sought - Mailing list pgsql-general

From Tom Lane
Subject Re: character datatype explaination sought
Date
Msg-id 3679884.1602771593@sss.pgh.pa.us
Whole thread Raw
In response to character datatype explaination sought  ("James B. Byrne" <byrnejb@harte-lyne.ca>)
List pgsql-general
"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



pgsql-general by date:

Previous
From: "James B. Byrne"
Date:
Subject: character datatype explaination sought
Next
From: Laurenz Albe
Date:
Subject: Re: character datatype explaination sought