From torque-user-return-6877-apmail-db-torque-user-archive=db.apache.org@db.apache.org Tue Mar 28 13:06:12 2006 Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 77472 invoked from network); 28 Mar 2006 13:06:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 28 Mar 2006 13:06:10 -0000 Received: (qmail 41640 invoked by uid 500); 28 Mar 2006 13:06:08 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 41621 invoked by uid 500); 28 Mar 2006 13:06:08 -0000 Mailing-List: contact torque-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Apache Torque Users List" Reply-To: "Apache Torque Users List" Delivered-To: mailing list torque-user@db.apache.org Received: (qmail 41610 invoked by uid 99); 28 Mar 2006 13:06:07 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Mar 2006 05:06:07 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [217.24.207.26] (HELO mail.seitenbau.net) (217.24.207.26) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Mar 2006 05:06:07 -0800 Received: from [192.168.15.18] (helo=www.seitenbau.net) by router.seitenbau.net with esmtp (Exim 4.43) id 1FODtJ-0000KY-GQ for torque-user@db.apache.org; Tue, 28 Mar 2006 15:05:45 +0200 In-Reply-To: Subject: Re: Postgresql, integer types, and size (Torque 3.2 only) To: "Apache Torque Users List" X-Mailer: Lotus Notes Release 6.5 September 26, 2003 Message-ID: From: Thomas Fischer Date: Tue, 28 Mar 2006 15:05:45 +0200 X-MIMETrack: Serialize by Router on www/seitenbau(Release 7.0.1|January 17, 2006) at 28.03.2006 03:05:45 PM MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N p.ledbrook@gmail.com schrieb am 28.03.2006 14:27:25: > On 27/03/06, Thomas Fischer wrote: > > I would claim this to be a problem of the schema.sql. If the column does > > not support a size, it should not be forces to take one, so the correct > > schema.xml would look like > > > > > default="0" javaType="primitive"/> > > Yes, but whether the column supports a size or not is > database-dependent, which I would have thought is something a database > abstraction layer should deal with. What I meant is that Torque should deal with the sizes in datatypes where a size makes sense. As always, "makes sense" is open to discussion :-), but in my opinion it does not make sense to have a size for boolean values. However, because "makes sense" is a very soft definition, you have convinced me that Torque should deal with superfluous sizes. In principle, Torque can do that, but the information for all data types of all databases has to be collected. > ... > As for the other issue, I discovered a workaround, although I'm not > sure how safe it is. First create a function in the database: > > CREATE FUNCTION bool2smallint(boolean) RETURNS smallint AS $$ > SELECT CASE WHEN $1 THEN INT2(1) ELSE INT2(0) END; > $$ LANGUAGE SQL; > > then add an implicit cast for converting booleans to smallints: > > CREATE CAST (boolean AS smallint) WITH FUNCTION bool2smallint AS IMPLICIT; I did not yet have time to look into the other issue, but from first thought, I hope to resolve the problem at a deeper level. Thomas --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org