I have used the next SQL statement in both MySQL and PostgreSQL:
db.Query(`SELECT COUNT(*) as N FROM email WHERE address = ?`, email)
But it fails in PostgreSQL with this error:
pq: F:"scan.l" M:"syntax error at end of input" S:"ERROR" C:"42601" P:"50" R:"scanner_yyerror" L:"993"
What's the problem? The error messages in PostgreSQL are very cryptic.
psql.PREPARE q AS SELECT COUNT(*) as N FROM email WHERE address = $1;thenEXECUTE q;.$1is the placeholder syntax forPREPARE, but your programming language probably uses?; otherwise there's no difference.