From: Martin Maciaszek Date: 2002-01-11T16:23:58+09:00 Subject: Re: DBI::InterfaceError: Unsupported Type (typeid=1034) In article , jweirich@one.net wrote: >>>>>> "Martin" == Martin Maciaszek writes: > > Martin> While experimenting with DBI and my PostgreSQL database I > Martin> stumbled upon this: > > Martin> irb(main):003:0> aResult = aConnection.select_all("select * from pg_class") > Martin> DBI::InterfaceError: Unsupported Type (typeid=1034) > Martin> from /usr/local/stow/ruby/lib/ruby/site_ruby/1.6/DBD/Pg/Pg.rb:265:in `convert' > [...] > > The column named relacl in the pg_class has a type ID of 1034. > Unfortunately, the type ID 1034 does not appear in the pg_type table > that the postgres driver uses to build the list of conversion > procedures. I'm not sure how to handle this. > > A short term workaround might be to select only the columns of type > pg_class that you are truly interested in, and omit the relacl column. > > If you really need the relacl column, you could locally modify the > load_type_map method in the Pg.rb file by adding the marked line > below. [snip] I don't really need the relacl column. I was just experimenting with DBI. But this solved the problem. If you need a complete list of data types in postgres you should take a look at src/include/catalog/pg_type.h (just did a quick grep). While we're at it. I was playing around with different sql queries. To make this easier I wrote a small script that takes the query from a html form and presents the results as a html database. This sorks fine except I don't know how to get the column names of the _result_. I know I can get them with aConnection("#{table}") but then I would need to parse the query string myself to know which tables were used in the query. I already wrote something similar in PHP where I used pg_fieldname to get the column names. Is there something similar in DBI? Cheers Martin