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