2013-07-10 21 views
1

我試圖使用的Postgres crosstab功能,其中指出,通過查詢必須返回3列:Postgres的交叉表:函數返回記錄稱爲背景下,不能接受類型的記錄

This statement must return one row_name column, one category column, and one value column.

然而,當我運行此查詢,我得到以下錯誤:

select crosstab('select entity_id, keyword_id, keyword_id from entity_keyword ORDER BY 1,2'); 

ERROR: function returning record called in context that cannot accept type record

我受夠了這種數據類型播放(在我的情況下,「價值」並不重要 - 它只是真/假),但不能告訴wh在投訴是關於。該查詢的結果集似乎符合要求。使用postgres 9.2.4。

回答

1

問題原來是select crosstab應該是select * from crosstab