Re: [CDBI] Type binding

Matt S Trout <dbix-class-uY5y5/[email protected]>
Newsgroups gmane.comp.lang.perl.modules.class-dbi
Message-ID <[email protected]>
Bill Moseley wrote:
> On Wed, Jun 07, 2006 at 02:54:10PM -0400, Perrin Harkins wrote:
>> On Tue, 2006-06-06 at 22:19 -0700, Bill Moseley wrote:
>>> I received this error on Postgresql 8.1.3:
>>>
>>> : DBD::Pg::st execute failed: ERROR:  invalid input syntax for type boolean: "34696"
>>>  [for Statement "SELECT me.id, me.cart, me.registration, me.transaction_by, me.transaction_time, me.amount, me.transaction_id, me.transaction_type, me.invoice, me.comment
>>> FROM   cart_transaction me
>>> WHERE  ( me.cart = ? )  ORDER BY transaction_time 
>>> " with ParamValues: 1='34696'] at /home/moseley/local/share/perl/5.8.4/DBIx/ContextualFetch.pm line 52.
>>>  at /home/moseley/local/share/perl/5.8.4/Class/DBI/Relationship/HasMany.pm line 144
>>>
>>> The query works fine in psql.
>> Try it in vanilla DBI.  It doesn't look like a Class::DBI thing, but
>> it's hard to be sure.  DBI is usually good about guessing data types.
> 
> It's now working after a restart of the mod_perl server.  I suspect
> if I tried it in DBI it would have also worked because it was a new
> process.
> 
> I'm now just curious about what happened to cause the problem to show
> up.

Presumably DBD::Pg caches the column metadata and gets exceedingly 
confused when the schema changes; I believe John Siracusa has run into 
all sorts of fun with DBD::Pg and schema changes in RDBO.

Rule of thumb seems to be "if you change the schema, restart the apps"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.