Re: Re: [GENERAL] Mapping PostgreSQL data types to DB2 Federated Server

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Re: [GENERAL] Mapping PostgreSQL data types to DB2 Federated Server
Date: 2012-10-15 03:27:10
Message-ID: 507B828E.8070509@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/14/12 6:37 PM, Alexander Gataric wrote:
> On 10/14/12 5:52 PM, Alexander Gataric wrote:
> >
> > I'm on a project which requires adding PostgreSQL tables to DB2 >
> Federated Server. I'm getting an error with PostgreSQL data types >
> boolean, text, bytea, and XML. I believe this can be solved with the >
> CREATE TYPE MAPPING in Fed Server. Does anyone know which values to >
> use? I'm not that familiar with Fed Server.

I googled db2 data types.
http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=%2Fcom.ibm.db2z10.doc.intro%2Fsrc%2Ftpc%2Fdb2z_datatypes.htm

Postgres' TEXT would map to VARCHAR(n) but you'll have to decide on a
suitable max length for you n value. ther's nothing like boolean, so
probably mapping it either to a SMALLINT where 't' is 1 and 'f' is 0, or
mapping it to a char(1) and just storing it as t/f for true/false.
BYTEA is equivalent to a BLOB, whatever DB2 uses for that. and DB2 is
supposed to have an XML type, but I suppose you could just map it to
VARCHAR(n) again, as XML is really just a bunch of text formatted with
html-like entities.

--
john r pierce N 37, W 122
santa cruz ca mid-left coast

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Condor 2012-10-15 05:16:47 Re: How to raise index points when equal and like is used with gist ?
Previous Message Shiran Kleiderman 2012-10-15 02:36:02 Re: Memory issues