Yii 查询结果截断别名
Yii query result cuts off alias
我的查询中有一个很长的别名,但我认为它没有超过允许的限制。我正在使用 Postgres 数据库和 Yii 1.1.15。查询运行良好并且 returns 正确的值,但我的结果切断了结果数组中的别名。
这是我的查询:
$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"),
.....
);
请注意,我的结果数组有一个键 "How many production lines at your company/division/location wil" 而不是 "How many production lines at your company/division/location will require"
我直接在数据库中运行同样的查询,我看到了同样的问题。
原来列名有64字节的限制。我读到有一种方法可以增加它,但这需要重新编译。
要增加更改 src/include/pg_config_manual.h 中的 NAMEDATALEN 常量并重新编译。
我的查询中有一个很长的别名,但我认为它没有超过允许的限制。我正在使用 Postgres 数据库和 Yii 1.1.15。查询运行良好并且 returns 正确的值,但我的结果切断了结果数组中的别名。
这是我的查询:
$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"),
.....
);
请注意,我的结果数组有一个键 "How many production lines at your company/division/location wil" 而不是 "How many production lines at your company/division/location will require"
我直接在数据库中运行同样的查询,我看到了同样的问题。
原来列名有64字节的限制。我读到有一种方法可以增加它,但这需要重新编译。
要增加更改 src/include/pg_config_manual.h 中的 NAMEDATALEN 常量并重新编译。