From: Sean C. <se...@ch...> - 2002-06-13 11:36:23
|
I'm writing a module that's selecting a 'timestamp without time zone' data type, but when I go to perform the select statement, I get the following error: /usr/local/lib/ruby/site_ruby/1.7/DBD/Pg/Pg.rb:261:in `convert': Unsupported Type (typeid=1114) (DBI::InterfaceError) from /usr/local/lib/ruby/site_ruby/1.7/DBD/Pg/Pg.rb:476:in `fill_array' from /usr/local/lib/ruby/site_ruby/1.7/DBD/Pg/Pg.rb:475:in `each_with_index' from /usr/local/lib/ruby/site_ruby/1.7/DBD/Pg/Pg.rb:475:in `each' from /usr/local/lib/ruby/site_ruby/1.7/DBD/Pg/Pg.rb:475:in `each_with_index' from /usr/local/lib/ruby/site_ruby/1.7/DBD/Pg/Pg.rb:475:in `fill_array' from /usr/local/lib/ruby/site_ruby/1.7/DBD/Pg/Pg.rb:457:in `fetchrow' from /usr/local/lib/ruby/site_ruby/1.7/DBD/Pg/Pg.rb:412:in `fetch' from /usr/home/sean/open_source/ruby-dbi/src/lib/dbi/dbi.rb:766:in `fetch' from /usr/home/sean/open_source/ruby-dbi/src/lib/dbi/dbi.rb:601:in `select_one' from /usr/home/sean/open_source/ruby-dbi/src/lib/dbi/dbi.rb:600:in `execute' from /usr/home/sean/open_source/ruby-dbi/src/lib/dbi/dbi.rb:600:in `select_one' from ./session/dbi.rb:47:in `dbi_load' from ./session.rb:50:in `call' from ./session.rb:50:in `load' from ./session.rb:48:in `each' from ./session.rb:48:in `load' from ./test.rb:23 Which is correct because typid 1114 doesn't exist as a typeid in the database. The problem is, it doesn't exist in the database and I don't know where the value 1114 is coming from. Any thoughts? I can send code/schema to anyone who's interested. -sc -- Sean Chittenden |
From: Michael N. <uu...@rz...> - 2002-07-08 18:45:09
|
On Sun, Jul 07, 2002 at 07:58:26PM -0700, Sean Chittenden wrote: > > > Which is correct because typid 1114 doesn't exist as a typeid in > > > the database. The problem is, it doesn't exist in the database > > > and I don't know where the value 1114 is coming from. Any > > > thoughts? I can send code/schema to anyone who's interested. -sc > > > > Can you send it me? > > > > Another similar problem is: > > > > select 'h' > > > > raises the following exception > > > > Unsupported Type (typeid=705) > > > > whereas > > > > select 'h'::text > > > > gives the correct result. > > I've verified that this is a fix for the problem. I've also gotten to > the point of being able to reproduce it reliably: > > echo "CREATE TABLE dbi_test ( t TIMESTAMP WITH OUT TIMEZONE NOT NULL );" | psql Sorry, but I can't create this table using PostgreSQL 7.2.1. If I omit "WITH OUT TIMEZONE", then it works. > # in dbi_test.rb > require 'dbi' > > DBI.connect('dbi:Pg:test') do |dbh| > dbh.select_all('SELECT t FROM dbi_test') do |row| > puts row.inspect > end > end > > > That'll throw it 100% of the time. Any ideas on a fix for this? -sc What tells the raised exception? Regards, Michael |
From: Sean C. <se...@ch...> - 2002-07-08 19:29:47
|
> > I've verified that this is a fix for the problem. I've also > > gotten to the point of being able to reproduce it reliably: > > > > echo "CREATE TABLE dbi_test ( t TIMESTAMP WITH OUT TIMEZONE NOT NULL );" | psql Grrr... typing too fast. echo "CREATE TABLE dbi_test ( t TIMESTAMP WITHOUT TIME ZONE NOT NULL );" | psql > Sorry, but I can't create this table using PostgreSQL 7.2.1. > If I omit "WITH OUT TIMEZONE", then it works. I needed to transpose a space. ::sigh:: > > # in dbi_test.rb > > require 'dbi' > > > > DBI.connect('dbi:Pg:test') do |dbh| > > dbh.select_all('SELECT t FROM dbi_test') do |row| > > puts row.inspect > > end > > end > > > > > > That'll throw it 100% of the time. Any ideas on a fix for this? -sc > > What tells the raised exception? /usr/local/lib/ruby/site_ruby/1.7/DBD/Pg/Pg.rb:289:in `convert': Unsupported Type (typeid=1114) (DBI::InterfaceError) from /usr/local/lib/ruby/site_ruby/1.7/DBD/Pg/Pg.rb:567:in `fill_array' from /usr/local/lib/ruby/site_ruby/1.7/DBD/Pg/Pg.rb:566:in `each_with_index' from /usr/local/lib/ruby/site_ruby/1.7/DBD/Pg/Pg.rb:566:in `each' from /usr/local/lib/ruby/site_ruby/1.7/DBD/Pg/Pg.rb:566:in `each_with_index' from /usr/local/lib/ruby/site_ruby/1.7/DBD/Pg/Pg.rb:566:in `fill_array' from /usr/local/lib/ruby/site_ruby/1.7/DBD/Pg/Pg.rb:519:in `fetchrow' from /usr/local/lib/ruby/site_ruby/1.7/DBD/Pg/Pg.rb:456:in `fetch' from /usr/local/lib/ruby/site_ruby/1.7/dbi/dbi.rb:742:in `fetch' from /usr/local/lib/ruby/site_ruby/1.7/dbi/dbi.rb:767:in `each' from /usr/local/lib/ruby/site_ruby/1.7/dbi/dbi.rb:595:in `select_all' from /usr/local/lib/ruby/site_ruby/1.7/dbi/dbi.rb:593:in `execute' from /usr/local/lib/ruby/site_ruby/1.7/dbi/dbi.rb:593:in `select_all' from tmp/dbi.rb:6 from tmp/dbi.rb:5:in `connect' from /usr/local/lib/ruby/site_ruby/1.7/dbi/dbi.rb:332:in `connect' from tmp/dbi.rb:5 -sc -- Sean Chittenden |