Prepared Statement on Postgresql in Rails
If you want to use prepare like that then you’ll need to make a couple changes: The PostgreSQL driver wants to see numbered placeholders ($1, $2, …) not question marks and you need to give your prepared statement a name: ActiveRecord::Base.connection.raw_connection.prepare(‘some_name’, “DELETE FROM my_table WHERE id = $1”) The calling sequence is prepare followed by … Read more