Tips when using postgresql

[ERROR] column “xxx” does not exist

This issue happens when run db=> select * from "ExxJobs" where status="Ongoing";
It returns

1
2
3
4
5
6
ERROR:  column "Ongoing" does not exist
LINE 1: select * from "ExxJobs" where status="Ongoing";
^
ERROR: column "ongoing" does not exist
LINE 1: select * from "ExxJobs" where status=Ongoing;
^

Solution
just change “” to ‘’.

1
2
3
4
5
db=> select * from "ExxJobs" where status='Ongoing';
id | type| xxxJobId | xxxJobUrl | status | errorMessage | createdAt | updatedAt
----+-----------------+----------+--------------------------------------------------------------------------------------------------------+---------+--------------+----------------------------+----------------------------
16 | ... | 22947534 | {"..."} | Ongoing | | 2020-05-18 06:17:32.525+00 | 2020-05-18 06:17:32.544+00
(1 row)

similarly:

1
2
3
4
5
6
cecdb=> delete from "ExxJobs" where 'xxxJobId'=22674314;
ERROR: invalid input syntax for integer: "xxxJobId"
LINE 1: delete from "ExxJobs" where 'xxxJobId'=22674314;

db=> delete from "ExxJobs" where "xxxJobId"='22674314';
DELETE 1