Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

delete "column does not exist"

I'm trying to execute a very simple delete query in Postgres

Query:

delete from "Tasks" where id = "fc1f56b5-ff41-43ed-b27c-39eac9354323";

Result:

ERROR:  column "fc1f56b5-ff41-43ed-b27c-39eac9354323" does not exist
LINE 1: delete from "Tasks" where id = "fc1f56b5-ff41-43ed-...

I have a simple table with a record where the id is that value. Why does it thing that "fc1f56b5-ff41-43ed-b27c-39eac9354323" is the column name?

like image 848
Catfish Avatar asked Oct 21 '25 04:10

Catfish


1 Answers

The problem is that you are using double quotes (") and single quotes (') interchangeably. SQL treats what's inside double quotes "" as an identifier (i.e., table name, proc name, column name, etc.), character constants need to be enclosed in single quotes

You can say:

delete from "Tasks" where id = 'fc1f56b5-ff41-43ed-b27c-39eac9354323'
like image 62
JustAPup Avatar answered Oct 22 '25 18:10

JustAPup



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!