我有一個SQL語句,像這樣的:Postgres的:檢查從XPath返回()
select coalesce(nullif(xpath('//consumer/contact_address/\@postcode', xml),'{}'), '') from consumer where docid = 12345;
它給了我一個錯誤:
ERROR: array value must start with "{" or dimension information
是什麼,即使是什麼意思?另外,如果我嘗試使用PSQL交互式提示,我得到另一個神祕的錯誤:
#psql: select nullif(xpath('//consumer/contact_address/\@street', xml), '{}') from consumer where docid = 12345;
WARNING: nonstandard use of escape in a string literal
LINE 1: select nullif(xpath('//consumer/contact_address/\@street', x...
^
HINT: Use the escape string syntax for escapes, e.g., E'\r\n'.
ERROR: could not identify an equality operator for type xml
有什麼不對嗎?謝謝!
這個問題是關於特定XPath引擎調用的參數數據類型。重新標記。 – 2011-02-07 16:13:16