Syntax error at end of input in PostgreSQL

You haven’t provided any details about the language/environment, but I’ll try a wild guess anyway:

MySQL’s prepared statements natively use ? as the parameter placeholder, but PostgreSQL uses $1, $2 etc. Try replacing the ? with $1 and see if it works:

WHERE address = $1

The error messages in PostgreSQL are very cryptic.

In general, I’ve found that Postgres error messages are better than competing products (ahem, MySQL and especially Oracle), but in this instance you’ve managed to confuse the parser beyond sanity. 🙂

Leave a Comment