X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E7DAD329D18 for ; Wed, 22 Sep 2004 13:33:51 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 44354-02 for ; Wed, 22 Sep 2004 12:33:45 +0000 (GMT) Received: from matrix.gatewaynet.com (matrix.gatewaynet.com [217.19.69.50]) by svr1.postgresql.org (Postfix) with ESMTP id 5C5A1329CAE for ; Wed, 22 Sep 2004 13:33:41 +0100 (BST) Received: from matrix.gatewaynet.com (localhost.localdomain [127.0.0.1]) by matrix.gatewaynet.com (8.12.8/8.12.8) with ESMTP id i8MBmXCC005504; Wed, 22 Sep 2004 14:48:33 +0300 Received: from localhost (achill@localhost) by matrix.gatewaynet.com (8.12.8/8.12.8/Submit) with ESMTP id i8MBmX4O005500; Wed, 22 Sep 2004 14:48:33 +0300 Date: Wed, 22 Sep 2004 14:48:33 +0300 (EEST) From: Achilleus Mantzios To: Marco Gaiarin Cc: pgsql-sql@postgresql.org Subject: Re: Porting problem from Informix to Postgres... In-Reply-To: <20040922121758.GG2319@sv.lnf.it> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-7 Content-Transfer-Encoding: 8BIT X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/199 X-Sequence-Number: 19045 O Marco Gaiarin έγραψε στις Sep 22, 2004 : > > On our organization we are porting an old, internally developed app, > that use Informix (SE 7.XX, on a sun box) as database backend and Gupta > Centura Team Developer 1.5.1 as development environment. > > Centura uses Informix via a native driver, for postgres we pass along > odbc. Our postgres environment are a set of intel box, loaded with > debian woody, so postgres 7.2.1. > > We have solved many problem, i've also make a little perl script that > convert a informix's dbexport dump into a set of file suitable to > import into postgres. > > > Now we are moving the app... we was happy, because seems that the only > modification needed was to alter some of the more complex query, > because of the difference on informix and postgres sql dialects. > > > But a big problem now arise: at the very beginning of this app, there > was a bug in handling of date in centura, so the guys circumvent this > converting all date in strings, and handle ``manually''. > Not sufficient, they don't do this with a wrapper function around date > field, but with ``casting'' data in varchar in the selects (with select > ... into ...) and only local computation. > It's dumb, i know. ;( > > > So now, on informix, a set of centura statement like: > > Call SqlPrepareAndExecute(hsql,'select dt_fatt from fatture into :una') > Call SqlFetchNext(hsql,err) > > make on string/variable :una a date like: > > '01-08-2001' > > for january 8, 2001, but on postgres we got: > > '2001-01-08' Just a dummy workaround (i am sure you'll find something better), dynacom=# SET DateStyle TO German ; SET dynacom=# SELECT replace(now()::date::text,'.','-'); replace ------------ 22-09-2004 > > > There's a way to alter globally the date format (apart PGDATESTYLE > variable, just tried with no luck), or there's a way to setup query to have > the correct date format? > > I've tried to use the mailing list search robots, but looking for > informix on this list (and on -general) make nothing. ;( > > > Many thanks. > > -- -Achilleus