您不能有空的結果集名稱。我認爲這是關係到你的previous question你在哪裏得到
t=# select json_object_agg(code,value) from tt;
json_object_agg
----------------------------------------------------
{ "ALLOW_MAC_ADDR" : "1", "USER_ALIAS" : "James" }
所以,如果你嘗試命名空值的列(最接近我覺得從您的文章的要求),你的錯誤:
t=# select json_object_agg(code,value) "" from tt;
ERROR: zero-length delimited identifier at or near """"
LINE 1: select json_object_agg(code,value) "" from tt;
^
當然你也可以用mokey空格字符本事,如:
t=# select json_object_agg(code,value) " " from tt;
----------------------------------------------------
{ "ALLOW_MAC_ADDR" : "1", "USER_ALIAS" : "James" }
這幾乎是沒有名字的,但我認爲你必須修改「postgREST API」在奧德r正確執行 - 忽略結果集屬性名稱