pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: luiz <luiz@planit.com.br>
To: pgsql-odbc@postgresql.org
Subject: Domain data types
Date: Tue, 26 Feb 2008 13:12:51 -0300
Message-ID: <20080226155632.M94796@planit.com.br> (raw)

Hi,

Odbc 8.01.300 don´t resolve domain data types and so return unexpected results.

I guess that this modification on PGAPI_Columns function can solve this.
It´s based on information_schema.columns view

I don´t have a compiler enviroment to test. I will be glad if someone can test
this.

PS.: I posted this on the bug track system, then I realized that post in the
BTS first might not be the correct procedure. Sorry for the noise.

Best Regards
Luiz
--
Plan IT Tecnologia Informatica Ltda.

Attachments:

info.diff (application/octet-stream, 1.4K) download Index: info.c =================================================================== RCS file: /cvsroot/psqlodbc/psqlodbc/info.c,v retrieving revision 1.148 diff -r1.148 info.c 2055,2058c2055,2060 < "select n.nspname, c.relname, a.attname, a.atttypid" < ", t.typname, a.attnum, a.attlen, a.atttypmod, a.attnotnull" < ", c.relhasrules, c.relkind, c.oid, d.adsrc from (((pg_catalog.pg_class c" < " inner join pg_catalog.pg_namespace n on n.oid = c.relnamespace", --- > "select n.nspname, c.relname, a.attname" > ", case when t.typtype = 'd' then t.typbasetype else a.atttypid end as atttypid" > ", coalesce(bt.typname, t.typname ) AS typname, a.attnum, a.attlen" > ", case when t.typtype = 'd' then t.typtypmod else a.atttypmod end as atttypmod" > ", a.attnotnull, c.relhasrules, c.relkind, c.oid, d.adsrc" > " from (((pg_catalog.pg_class c inner join pg_catalog.pg_namespace n on n.oid = c.relnamespace", 2080,2082c2082,2085 < " and a.attrelid = c.oid) inner join pg_catalog.pg_type t" < " on t.oid = a.atttypid) left outer join pg_attrdef d" < " on a.atthasdef and d.adrelid = a.attrelid and d.adnum = a.attnum"); --- > " and a.attrelid = c.oid)" > " inner join pg_catalog.pg_type t on t.oid = a.atttypid)" > " left outer join pg_attrdef d on a.atthasdef and d.adrelid = a.attrelid and d.adnum = a.attnum" > " left outer join pg_type bt on t.typtype = 'd' and t.typbasetype = bt.oid" );

Message-ID: <20080226155632.M94796@planit.com.br>
Permalink:  ../20080226155632.M94796@planit.com.br/
Also on:    postgresql.org/message-id/20080226155632.M94796@planit.com.br

 ·  · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: luiz@planit.com.br
  Subject: Re: Domain data types
  In-Reply-To: <20080226155632.M94796@planit.com.br>
  References: <20080226155632.M94796@planit.com.br>

* 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