Re: Using java.lang.Character for "char" data type - Mailing list pgsql-jdbc

From Kevin Grittner
Subject Re: Using java.lang.Character for "char" data type
Date
Msg-id 4BFE848A0200002500031B8F@gw.wicourts.gov
Whole thread Raw
In response to Re: Using java.lang.Character for "char" data type  (Lew <noone@lewscanon.com>)
List pgsql-jdbc
Lew <noone@lewscanon.com> wrote:

> I'm a little confused.  When you say "char" is a byte long, are
> you referring to the SQL type or the Java type?  I'm used to
> seeing the Java type expressed in lower case and the SQL type in
> upper case, so please pardon my confusion.

PostgreSQL supports the standard CHAR(n) including the special case
of CHAR to mean one character, but also supports a type of "char"
(notice the lower-case letters and the quotes), which is distinct,
and is a one-byte type.  "char" is not intended to be used by
application code, generally.  It's a micro-optimization used for
system tables, and thus not very well documented.  Use at your own
risk.  Or use CHAR or VARCHAR (without quotes).

-Kevin

pgsql-jdbc by date:

Previous
From: Lew
Date:
Subject: Re: JDBC Driver and timezones
Next
From: Dobes
Date:
Subject: setBlob() copies the blob, even it was already a PostgreSQL blob!