View Issue Details

IDProjectCategoryView StatusLast Update
0000190Composrcore_database_driverspublic2010-07-15 18:46
Reporterartumi_richardAssigned ToChris Graham 
SeverityMajor-bug 
Status resolvedResolutionfixed 
Product Version 
Fixed in Version 
Summary0000190: Install fails on postgresql
DescriptionDuring install
Unfortunately a query has failed [ALTER TABLE cms4_f_member_custom_fields ADD field_14 text NOT NULL] [ERROR: column "field_14" contains null values]
Additional InformationIn sources/database_helper.php line 310 you have

if ($_type!='LONG_TEXT') $extra=is_null($default)?'DEFAULT NULL':(' DEFAULT '.(is_string($default)?('\''.db_escape_string($default).'\''):strval($default)));

The SQL postgresql needs is

"ALTER TABLE cms4_f_member_custom_fields ADD field_14 text NOT NULL default ''"

And if it were not for the if then the code would produce this. But it must be there for a reason... But removing the if and having the code run everytime is the fix for postgresql...
TagsNo tags attached.
Time estimation (hours)
Sponsorship open

Activities

Chris Graham

2010-07-15 18:46

administrator   ~0000060

I think it must be that some DB's use blob's for the LONG_TEXT implementation and in those DB's the blob values don't allow default's.
I've put in an '||' clause for postgresql in the file. A bit of an architectural issue, so we'll have to review the DB driver structure if we do end up doing a full compatibility review in the future.

Issue History

Date Modified Username Field Change