In PHP when using PDO to query my PostgreSQL database I have this query
$stmt = $myPDO->prepare(
"SELECT clientid,status,action,datecompleted FROM clientapi.table1"
);
$stmt->execute();
As you can see, the database uses several reserved words as column names, status & action. Should I be escaping these with backticks? And if yes, should I only escape the reserved words? Lastly this query does already run fine without any issues without escaping them