pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Craig Ringer <craig@postnewspapers.com.au>
Cc: Віталій Тимчишин <tivv00@gmail.com>
Cc: PG-JDBC Mailing List <pgsql-jdbc@postgresql.org>
Subject: Re: Using java.lang.Character for "char" data type
Date: Mon, 24 May 2010 14:25:51 -0400 (EDT)
Message-ID: <alpine.BSO.2.00.1005241406480.1152@leary.csoft.net> (raw)
In-Reply-To: <4BF7A718.50607@postnewspapers.com.au>
References: <AANLkTinKef9bhdEhYMMzxiRLKUXtGt_cUOnIPT5sibXI@mail.gmail.com>
	<alpine.BSO.2.00.1005211813180.22460@leary.csoft.net>
	<4BF7A718.50607@postnewspapers.com.au>



On Sat, 22 May 2010, Craig Ringer wrote:

> So really the appropriate SQL type for Java 'Character' is varchar(1) ?

Yes.

>  And a PostgreSQL 'char' (bpchar, not character(1)) maps best to a Java 
> 'Byte' ?

I'm not so sure about that.  "char" is still intended to represent a 
textual identifier, not a numeric value as Byte does.  Additionally you 
can't store 0 in a "char".

When you're talking about a mapping there's two directions, setObject and 
getObject, and they're not always symmetric.  If we allowed setObject with 
a Character to map to varchar, then I would not expect getObject to return 
a Character, I'd expect a String.

Kris Jurka



view thread (8+ messages)  latest in thread

Message-ID: <alpine.BSO.2.00.1005241406480.1152@leary.csoft.net>
Permalink:  ../alpine.BSO.2.00.1005241406480.1152@leary.csoft.net/
Also on:    postgresql.org/message-id/alpine.BSO.2.00.1005241406480.1152@leary.csoft.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: books@ejurka.com, craig@postnewspapers.com.au, tivv00@gmail.com
  Subject: Re: Using java.lang.Character for "char" data type
  In-Reply-To: <alpine.BSO.2.00.1005241406480.1152@leary.csoft.net>
  References: <AANLkTinKef9bhdEhYMMzxiRLKUXtGt_cUOnIPT5sibXI@mail.gmail.com> <alpine.BSO.2.00.1005211813180.22460@leary.csoft.net> <4BF7A718.50607@postnewspapers.com.au> <alpine.BSO.2.00.1005241406480.1152@leary.csoft.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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