in reply to Lost with DBI in postgresql

It looks like one of your parameters is not being quoted.

Use DBI->trace(2) before your prepare statement to get the query that is being passed to the DBMS.

See Before asking a database related question ... for a simple example of how to use trace.

If the problem is that your placeholder mechanism is not acting correctly, try quoting the offending parameter explicitly.