PostgreSQL UUID 文字:错误:语法错误在或附近

Mal*_*umi 3 postgresql syntax uuid

每当我使用 UUID 作为文字时,我都会得到

SELECT a82857b6-e336-4c6c-8499;
ERROR:  syntax error at or near "-"
Run Code Online (Sandbox Code Playgroud)

我认为这可能是编码问题,但似乎并非如此。

a_h*_*ame 6

如手册中所述,字符串常量(或一般而言:任何不是数字的东西)需要用单引号括起来:

ALTER TABLE newarts ALTER COLUMN jurisdiction_id 
   SET DEFAULT 'a82857b6-e336-4c6c-8499-4242';
Run Code Online (Sandbox Code Playgroud)