Whever I use a UUID as a literal, I get
SELECT a82857b6-e336-4c6c-8499;
ERROR: syntax error at or near "-"
I thought it might be an encoding issue, but that doesn't seem to be it.
Evan Carroll
65.7k50 gold badges259 silver badges510 bronze badges
asked Feb 5, 2016 at 18:49
1 Answer 1
As documented in the manual, string constants (or in general: anything that is not a number) need to be enclosed in single quotes:
ALTER TABLE newarts ALTER COLUMN jurisdiction_id
SET DEFAULT 'a82857b6-e336-4c6c-8499-4242';
answered Feb 5, 2016 at 18:58
user1822user1822
-
OF COURSE! But that's why sometimes I need another pair of eyes. It is more like a string than an integer. I just didn't see / think of it. Thanks.Malik A. Rumi– Malik A. Rumi2016年02月05日 20:29:06 +00:00Commented Feb 5, 2016 at 20:29
lang-sql