Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.0b4

Bug #14292 alterTable() cannot change column type when no implicit cast is defined
Submitted: 2008-07-04 13:26 UTC Modified: 2008-08-05 03:25 UTC
From: hschletz Assigned: quipo
Status: Closed Package: MDB2_Driver_pgsql (version 1.5.0b1)
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    
Subscription  


 [2008-07-04 13:26 UTC] hschletz (Holger Schletz)
Description: ------------ The alterTable() function can only change a column's type if an implicit cast function is defined for the particular datatypes. If this is not the case (like for converting a 'text' column to 'integer'), PostgreSQL will return an error: ERROR: column "foo" cannot be cast to type "pg_catalog.int4" The attached patch adds an explicit cast to the ALTER TABLE command, allowing such conversions if an explicit cast function is defined. This is quite safe because it will still fail if a particular value can not be cast (for example, the string '42' can be converted to integer, but 'abc' can not).

Comments

 [2008-08-05 03:25 UTC] quipo (Lorenzo Alberton)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.