我正在尝试直接连接到postgres数据库并运行查询。它告诉我表,这是一个视图不存在,但我看到它列出。我错过了什么?
require 'pg'
conn = PG::Connection.open(:dbname => 'mydatabase')
conn.exec("Select * From Distinct_filing_xml_view")
PG::UndefinedTable: ERROR: relation "distinct_filing_view" does not exist
LINE 1: Select * From Distinct_filing_xml_view
^
from (irb):5:in `exec'
from (irb):5
from /Users/aa/.rbenv/versions/2.3.3/bin/irb:11:in `<main>'
res= conn.exec("select table_name from INFORMATION_SCHEMA.views")
res.each {|i| puts i }
{"table_name"=>"Max_filing_xml_view"}
{"table_name"=>"Distinct_filing_xml_view"}
{"table_name"=>"Filing_xml_view"}
{"table_name"=>"select_in_max_subdate_view"}
{"table_name"=>"max_sub_date"}
res = conn.exec('Select * From "Distinct_filing_xml_view"')
有谁知道为什么需要报价?