pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedcharacter datatype explaination sought
4+ messages / 4 participants
[nested] [flat]
* character datatype explaination sought
@ 2020-10-15 14:07 James B. Byrne <byrnejb@harte-lyne.ca>
2020-10-15 14:19 ` Re: character datatype explaination sought Tom Lane <tgl@sss.pgh.pa.us>
2020-10-15 14:19 ` Re: character datatype explaination sought Laurenz Albe <laurenz.albe@cybertec.at>
2020-10-15 14:21 ` Re: character datatype explaination sought Adrian Klaver <adrian.klaver@aklaver.com>
0 siblings, 3 replies; 4+ messages in thread
From: James B. Byrne @ 2020-10-15 14:07 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
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,
--
*** e-Mail is NOT a SECURE channel ***
Do NOT transmit sensitive data via e-Mail
Unencrypted messages have no legal claim to privacy
Do NOT open attachments nor follow links sent by e-Mail
James B. Byrne mailto:ByrneJB@Harte-Lyne.ca
Harte & Lyne Limited http://www.harte-lyne.ca
9 Brockley Drive vox: +1 905 561 1241
Hamilton, Ontario fax: +1 905 561 0757
Canada L8E 3C3
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: character datatype explaination sought
2020-10-15 14:07 character datatype explaination sought James B. Byrne <byrnejb@harte-lyne.ca>
@ 2020-10-15 14:19 ` Tom Lane <tgl@sss.pgh.pa.us>
2 siblings, 0 replies; 4+ messages in thread
From: Tom Lane @ 2020-10-15 14:19 UTC (permalink / raw)
To: byrnejb@harte-lyne.ca; +Cc: pgsql-general@lists.postgresql.org
"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
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: character datatype explaination sought
2020-10-15 14:07 character datatype explaination sought James B. Byrne <byrnejb@harte-lyne.ca>
@ 2020-10-15 14:19 ` Laurenz Albe <laurenz.albe@cybertec.at>
2 siblings, 0 replies; 4+ messages in thread
From: Laurenz Albe @ 2020-10-15 14:19 UTC (permalink / raw)
To: byrnejb@harte-lyne.ca; pgsql-general@lists.postgresql.org
On Thu, 2020-10-15 at 10:07 -0400, James B. Byrne wrote:
> 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 is the same, only in the first version the type cast is explicit.
Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: character datatype explaination sought
2020-10-15 14:07 character datatype explaination sought James B. Byrne <byrnejb@harte-lyne.ca>
@ 2020-10-15 14:21 ` Adrian Klaver <adrian.klaver@aklaver.com>
2 siblings, 0 replies; 4+ messages in thread
From: Adrian Klaver @ 2020-10-15 14:21 UTC (permalink / raw)
To: byrnejb@harte-lyne.ca; pgsql-general@lists.postgresql.org
On 10/15/20 7:07 AM, James B. Byrne wrote:
> 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. From here:
https://www.postgresql.org/docs/current/typeconv-query.html
"... bpchar (“blank-padded char”, the internal name of the character
data type) ..."
>
>
>
--
Adrian Klaver
adrian.klaver@aklaver.com
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2020-10-15 14:21 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-10-15 14:07 character datatype explaination sought James B. Byrne <byrnejb@harte-lyne.ca>
2020-10-15 14:19 ` Tom Lane <tgl@sss.pgh.pa.us>
2020-10-15 14:19 ` Laurenz Albe <laurenz.albe@cybertec.at>
2020-10-15 14:21 ` Adrian Klaver <adrian.klaver@aklaver.com>
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