PG :: InvalidParameterValue:错误:无法在标量上调用json_array_elements

时间:2016-08-10 06:42:54

标签: ruby-on-rails json postgresql

当我在使用JSON列的表上查询时,我收到此错误。

  

PG :: InvalidParameterValue:错误:无法在标量上调用json_array_elements

表格结构

create_table :certificates, force: true do |t|
  t.column   :completions, :json
  t.datetime :created_at,  null: false
  t.datetime :updated_at,  null: false
end

查询

WITH completions AS (
  SELECT *, json_array_elements(completions) AS completions_json
  FROM certificates
)
SELECT * from completions;

0 个答案:

没有答案