4

I have a DB table that someone else created, its PK is a single column of type 'uuid'. I'm struggling to perform a simple select by that column. Examples I have tried with no success:

select from site where id = "9d4da323-4c20-360f-bd9b-ec54feec54f0"

select from site where id = UUID('9d4da323-4c20-360f-bd9b-ec54feec54f0')

select from site where id::text = '9d4da323-4c20-360f-bd9b-ec54feec54f0'

what's the right syntax?

1
4

A colleague enlightened me: it was the double quotes around the string literal. The right syntax is:

select from site where id = '9d4da323-4c20-360f-bd9b-ec54feec54f0'

I'm answering my own question, hoping that this helps someone else in the future.

3

Not the answer you're looking for? Browse other questions tagged or ask your own question.