Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 9F34F2E3141 for ; Thu, 3 Jan 2008 12:33:52 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 60583-05 for ; Thu, 3 Jan 2008 12:33:49 -0400 (AST) Received: from lists.commandprompt.com (host-159.commandprompt.net [207.173.203.159]) by postgresql.org (Postfix) with ESMTP id 83DB92E0338 for ; Thu, 3 Jan 2008 12:33:48 -0400 (AST) Received: from [77.109.28.238] ([77.109.28.238]) (authenticated bits=0) by lists.commandprompt.com (8.13.8/8.13.8) with ESMTP id m03GXg84012399 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 3 Jan 2008 08:33:48 -0800 Message-ID: <477D0E5F.9040705@commandprompt.com> Date: Thu, 03 Jan 2008 18:33:35 +0200 From: Andrei Kovalevski User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Richard Broersma Jr CC: Postgresql ODBC List Subject: Re: possible ODBC bug with '-infinity' References: <806471.5688.qm@web31811.mail.mud.yahoo.com> In-Reply-To: <806471.5688.qm@web31811.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]); Thu, 03 Jan 2008 08:33:52 -0800 (PST) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200801/2 X-Sequence-Number: 9309 Hello, Happy New Year! Richard Broersma Jr wrote: > --- On Mon, 12/3/07, Andrei Kovalevski wrote: > > >> Are you sure these values are equal? Try this in PgAdmin: >> >> create table t (t timestamp); >> insert into t values ('-infinity'); >> insert into t values ('infinity'); >> insert into t values ('9999-12-31 23:59:59'); >> insert into t values ('5874897-12-31 23:59:59'); >> insert into t values ('5874897-12-31 >> 23:59:59.999999999'); >> --insert into t values ('5874898-01-01 00:00:00'); >> select t::date, t::time, t::timestamp, t::varchar from t; >> > > Now the real question is, "What does and ODBC client do with these value?". > > Also, don't forget to include values for -infinity and other timestamps that are smaller than what the client side application can display. > ODBC supports dates and timestamps as: typedef struct tagTIMESTAMP_STRUCT { SQLSMALLINT year; .......... } TIMESTAMP_STRUCT; So, it can't show dates bigger then 32,767 or smaller then -32,768. I think - correct driver behavour should be: 1) driver returns NULL value for SQL_DATE_STRUCT and SQL_TIMESTAMP_STRUCT 2) function return value should be SQL_SUCCESS_WITH_INFO; 3) driver also sets Informative Description for this error with actual value - if possible. -- Andrei Kovalevski PostgreSQL Replication, Consulting, Custom Development, 24x7 support Managed Services, Shared and Dedicated Hosting Co-Authors: plPHP, ODBCng - http://www.commandprompt.com/