postgresql:何时使用数组构造函数与大括号

Wes*_*esR 3 postgresql

我试图理解为什么这是一个语法错误:

SELECT distinct precinct FROM ballots
WHERE code_string = ANY (
  { '20000420300098', '20001240300074'})
Run Code Online (Sandbox Code Playgroud)

虽然这成功了?

SELECT distinct precinct FROM ballots
WHERE code_string = ANY (
  ARRAY[ '20000420300098', '20001240300074'])
Run Code Online (Sandbox Code Playgroud)

根据https://www.postgresql.org/docs/9.1/static/arrays.html它们应该是等效的。

Ry-*_*Ry- 5

大括号用于数组的文本表示。

SELECT distinct precinct FROM ballots
WHERE code_string = ANY (
  '{20000420300098,20001240300074}')
Run Code Online (Sandbox Code Playgroud)