pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michalis Kabrianis <lists@interzone.gr>
To: Marco Gaiarin <gaio@sv.lnf.it>
Cc: pgsql-sql@postgresql.org
Subject: Re: Porting problem from Informix to Postgres...
Date: Wed, 22 Sep 2004 15:34:43 +0300
Message-ID: <41517163.7010707@interzone.gr> (raw)
In-Reply-To: <20040922121758.GG2319@sv.lnf.it>
References: <20040922121758.GG2319@sv.lnf.it>

Marco Gaiarin wrote:
> 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'
> 
> 
> 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?
> 

Wouldn't
set datestyle to postgres; (or something else, try iso,mdy, I think it 
depends on your locale) do the trick?
You can also try to put it in postgresql.conf if I'm not wrong

Michalis

 > I've tried to use the mailing list search robots, but looking for
 > informix on this list (and on -general) make nothing. ;(
 >
 >
 > Many thanks.
 >



view thread (6+ messages)  latest in thread

Message-ID: <41517163.7010707@interzone.gr>
Permalink:  ../41517163.7010707@interzone.gr/
Also on:    postgresql.org/message-id/41517163.7010707@interzone.gr

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: lists@interzone.gr, gaio@sv.lnf.it
  Subject: Re: Porting problem from Informix to Postgres...
  In-Reply-To: <41517163.7010707@interzone.gr>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox