Received: from averstak.campus.vt.edu (averstak.campus.vt.edu [198.82.91.99]) by hub.org (8.9.3/8.9.3) with ESMTP id KAA69420 for ; Tue, 7 Mar 2000 10:11:22 -0500 (EST) (envelope-from alex@averstak.campus.vt.edu) Received: from averstak (localhost [127.0.0.1]) by averstak.campus.vt.edu (8.9.3/8.9.3) with ESMTP id KAA60856 for ; Tue, 7 Mar 2000 10:19:42 -0500 (EST) (envelope-from alex@averstak.campus.vt.edu) Message-Id: <200003071519.KAA60856@averstak.campus.vt.edu> X-Mailer: exmh version 2.0.2 2/24/98 From: "Alex Verstak" To: pgsql-interfaces@postgreSQL.org Subject: Re: [INTERFACES] Type mappings In-reply-to: Your message of "Tue, 07 Mar 2000 08:46:02 +0100." <200003070746.IAA08297@ns.aura.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 07 Mar 2000 10:19:42 -0500 Sender: alex@averstak.campus.vt.edu tomas@aura.de wrote: > Obe of the things squile tries is to transform the database > types into native language types. > > For PostgreSQL this would imply looking things up in the > pg_types table and figuring out what to do. ... > - jdbc looks the type name (via the oid, as given by PQftype()) > and decides based on that. The result is cached (which to me > looks a bit problematic, since the contents of the table could > change at run time, but I may be too pedantic here ;) Types don't change too often. Not often enough to hurt the UI's anyway, which is what JDBC is for. On the other hand, speed gain from caching type information is significant. > It would be interesting to write up a type mapper which could be > of some more general utility (no idea whether this would be > feasible at all). I'd be willing to give it a try. It is a useful thing. E.g. my project needs conversion between SDDF, SQL, (restricted form of) Prolog, and Jess (don't ask why--it's a long story). I would definitely appreciate a generic type mapper. It is feasible too. My chicken scratch has worked so far. :) > I would appreciate any pointers in this directions. JDBC source has the queries you need. PostgreSQL manual decribes the types. It's just a matter of sitting down and writing a pretty wrapper/converter. =alex