0

我的查询中有一个很长的别名,但我认为它没有超出允许的限制。我正在使用 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"),
  .....
);

请注意,我的结果数组的键是“贵公司/部门/位置将有多少条生产线”而不是“贵公司/部门/位置需要多少条生产线”

4

1 回答 1

0

我直接在数据库中运行相同的查询,我看到了同样的问题。

事实证明,列名有 64 个字节的限制。我读到有一种方法可以增加它,但这需要重新编译。

要增加更改 src/include/pg_config_manual.h 中的 NAMEDATALEN 常量并重新编译。

于 2015-08-13T02:46:47.167 回答