Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 6F4D92E00CE for ; Mon, 3 Dec 2007 09:46:55 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 47956-03 for ; Mon, 3 Dec 2007 09:46:40 -0400 (AST) Received: from lists.commandprompt.com (host-159.commandprompt.net [207.173.203.159]) by postgresql.org (Postfix) with ESMTP id 058202E00A9 for ; Mon, 3 Dec 2007 09:46:47 -0400 (AST) Received: from [77.109.29.168] ([77.109.29.168]) (authenticated bits=0) by lists.commandprompt.com (8.13.8/8.13.8) with ESMTP id lB3DkcAt019587 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 3 Dec 2007 05:46:43 -0800 Message-ID: <475408B6.2010700@commandprompt.com> Date: Mon, 03 Dec 2007 15:46:30 +0200 From: Andrei Kovalevski User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 CC: Postgresql ODBC List Subject: Re: possible ODBC bug with '-infinity' References: <633255.45744.qm@web31809.mail.mud.yahoo.com> In-Reply-To: <633255.45744.qm@web31809.mail.mud.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0 (lists.commandprompt.com [207.173.203.159]); Mon, 03 Dec 2007 05:46:46 -0800 (PST) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/3 X-Sequence-Number: 9281 Hello. Richard Broersma Jr wrote: > --- On Sun, 12/2/07, Hiroshi Inoue wrote: > > >> Do you think it is an appropriate handling ? >> > > This is a good question. I am not sure what an appropriate handling would be. My first test of '-infinity' (which resulted in a raised error) was with an ado recordset. Since you are questioning what is appropriate I thought that I should try a few different client front ends to see how they treated (+/-)infinity: > > Client | -infinity | + infinity > ADO | |9999-12-31 23:59:59| > Access/LT|1899-11-30 00:00:00|9999-12-31 23:59:59| > OOB(ODBC)|0001-01-03 00:00:00|9999-12-31 23:59:59| > > ADO = ado recordset created in VB > Access/LT = a linked tabled in MS-Access (probably DAO/ODBC?) > OOB(ODBC) = Open Office.org Base ODBC connection to the Database. > > Having done further tests, it seems that the error must be a bug with ADO since other clients have not a problem with making -infinity equal to the smallest time stamp that their respective data type can display. In my case, I do not really care about what time stamp values are displayed by the clients for (+/-) infinity since I use these values as an implied NULL value for time stamps. Unfortunately, ADO is broken and can't display any value for -infinity. > > >> How do you think the driver should treat -infinity ? >> > > It seems that it already handles it correctly. I was mistaken in thinking that the translation of (+/-) infinity was handled by ODBC. :o) > It should be handled by ODBC because of possible type conversions on the ODBC driver layer. Take a look: http://msdn2.microsoft.com/en-us/library/ms709280aspx. Table shows required conversions. Also all Microsoft applications notify ODBC driver by setting additional parameter during initialization. I think ADO requests 'inifinity' value as SQL_C_CHAR and sure it doesn't expect it to be 'infinity'. > Regards, > Richard Broersma Jr. > > ---------------------------(end of broadcast)--------------------------- > TIP 6: explain analyze is your friend >