Re: character datatype explaination sought

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: character datatype explaination sought
Дата
Msg-id 3679884.1602771593@sss.pgh.pa.us
обсуждение исходный текст
Ответ на character datatype explaination sought  ("James B. Byrne" <byrnejb@harte-lyne.ca>)
Список 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 по дате отправления:

Предыдущее
От: "James B. Byrne"
Дата:
Сообщение: character datatype explaination sought
Следующее
От: Laurenz Albe
Дата:
Сообщение: Re: character datatype explaination sought