Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id BB309632DC4 for ; Mon, 24 May 2010 15:26:01 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 54637-05 for ; Mon, 24 May 2010 18:25:54 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail63.csoft.net (mail63.csoft.net [205.205.214.4]) by mail.postgresql.org (Postfix) with ESMTP id 7D619633162 for ; Mon, 24 May 2010 15:25:54 -0300 (ADT) Received: from mail63.csoft.net (localhost [127.0.0.1]) by mail63.csoft.net (Postfix) with ESMTP id 2498A28426; Mon, 24 May 2010 14:25:52 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=csoft.net; h=date:from:to :cc:subject:in-reply-to:message-id:references:mime-version :content-type; s=sel1; bh=LBIYNMrPVYQK9DvI0cehFGCdEqs=; b=hvRlmH l6Hlyc4X0RuOyeZlVZU7xOUQfxa23ye/MC8l8jPWTyXAxy+nvkPdVWGdAvh6qWHd 6TBywTaGL9J1Bj/selpQjqMTxB7b5zA2fTmpFZ+OyTekn05kpGYOi8FNj3DKGC9A Jufo9ZNV83TJuPGc4HOT8+HOov8NsdF9nzDKE= Received: from leary.csoft.net (leary.csoft.net [205.205.214.5]) by mail63.csoft.net (Postfix) with ESMTP id 197DE28424; Mon, 24 May 2010 14:25:52 -0400 (EDT) Received: by leary.csoft.net (Postfix, from userid 1112) id D0B7AA2FC; Mon, 24 May 2010 14:25:51 -0400 (EDT) Date: Mon, 24 May 2010 14:25:51 -0400 (EDT) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Craig Ringer cc: =?KOI8-U?B?96bUwcymyiD0yc3eydvJzg==?= , PG-JDBC Mailing List Subject: Re: Using java.lang.Character for "char" data type In-Reply-To: <4BF7A718.50607@postnewspapers.com.au> Message-ID: References: <4BF7A718.50607@postnewspapers.com.au> User-Agent: Alpine 2.00 (BSO 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201005/69 X-Sequence-Number: 20553 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