Skip site navigation (1) Skip section navigation (2)

Re: Using java.lang.Character for "char" data type

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Lew" <noone(at)lewscanon(dot)com>,<pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Using java.lang.Character for "char" data type
Date: 2010-05-27 19:41:14
Message-ID: 4BFE848A0200002500031B8F@gw.wicourts.gov (view raw or flat)
Thread:
Lists: pgsql-jdbc
Lew <noone(at)lewscanon(dot)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

In response to

pgsql-jdbc by date

Next:From: DobesDate: 2010-05-27 21:37:25
Subject: setBlob() copies the blob, even it was already a PostgreSQL blob!
Previous:From: Daniel MigowskiDate: 2010-05-27 14:00:31
Subject: Re: Exception 'org.postgresql.util.PSQLException' could not be instantiated

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group