我的查询中有一个很长的别名,但我不认为它高于允许的限制。我正在使用Postgres数据库和Yii 1.1.15。查询运行正常并返回正确的值,但我的结果会切断结果数组中的别名。
这是我的疑问:
$query = Yii::app()->db->createCommand()
->select("mytable AS How many production lines at your company/division/location will require")
->from($table);
$result = $query->query();
我的结果如下:
$result = array(
array('How many production lines at your company/division/location wil' => string(18) "None/doesn't apply"),
array('How many production lines at your company/division/location wil' => string(18) "None"),
.....
);
请注意,我的结果数组的关键字是“贵公司/部门/地点的生产线数量”,而不是“贵公司/部门/地点需要多少生产线”
答案 0 :(得分:0)
我直接在数据库中运行了相同的查询,我看到了同样的问题。
事实证明,列名称有64个字节的限制。我读到有一种方法可以增加它,但这需要重新编译。
在src / include / pg_config_manual.h中增加更改NAMEDATALEN常量并重新编译。