Das pg Gem möchte, dass Sie nummerierte Platzhalter verwenden ($1 , $2 , ...) anstelle von Positionsplatzhaltern (? ):
conn = PG.connect(:dbname => 'db1')
conn.prepare('statement1', 'insert into table1 (id, name, profile) values ($1, $2, $3)')
conn.exec_prepared('statement1', [ 11, 'J.R. "Bob" Dobbs', 'Too much is always better than not enough.' ])
Das feine Handbuch hat dies zu sagen:
Und wieder für exec_prepared
: