[CDBI] Type binding

Bill Moseley moseley at hank.org
Wed Jun 7 06:19:44 BST 2006

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.

I just want to make sure my assumption is correct:  I had done an:

    alter table cart_transactions add column transaction_id text;

before that error happened.  My guess is that confused what columns
were bound as boolean.  But, that table doesn't have any booleans, so
I'm wondering if that's the wrong assumption.  Plus, I'm not clear
what's doing the type binding in the first place.

So, does the above error makes sense with respect to changing the
schema, and if so can you give an explanation of what's happening? ;)


 \d cart_transaction;
                                        Table "public.cart_transaction"
      Column      |            Type             |                           Modifiers                           
 id               | integer                     | not null default nextval('cart_transaction_id_seq'::regclass)
 cart             | integer                     | not null
 registration     | integer                     | 
 transaction_by   | integer                     | 
 transaction_time | timestamp(0) with time zone | not null default now()
 transaction_type | integer                     | not null
 amount           | numeric                     | not null default 0
 invoice          | integer                     | 
 comment          | text                        | 
 transaction_id   | text                        | 
    "cart_transaction_pkey" PRIMARY KEY, btree (id)
Foreign-key constraints:
    "cart_transaction_cart_fkey" FOREIGN KEY (cart) REFERENCES cart(id)
    "cart_transaction_invoice_fkey" FOREIGN KEY (invoice) REFERENCES invoice(id)
    "cart_transaction_registration_fkey" FOREIGN KEY (registration) REFERENCES registration(id)
    "cart_transaction_transaction_by_fkey" FOREIGN KEY (transaction_by) REFERENCES person(id)
    "cart_transaction_transaction_type_fkey" FOREIGN KEY (transaction_type) REFERENCES transaction_type(id)

Bill Moseley
moseley at hank.org

More information about the ClassDBI mailing list