Did some googling for about half a day and I can't find any sample of a prepared INSERT statement using the pg gem (postgresql ruby gem).
I tried this (after looking at the gem docs):
def test2
conn = PG.connect( dbname: 'db1' )
conn.prepare("statement1", 'INSERT INTO table1 (id, name, profile) VALUES (?, ?, ?)')
end
But I get the following error:
pgtest.rb:19:in `prepare': ERROR: syntax error at or near "," (PG::Error)
LINE 1: INSERT INTO table1 (id, name, profile) VALUES (?, ?, ?)
^
from pgtest.rb:19:in `test2'
from pgtest.rb:25:in `<main>'
ERROR: ... (PG::Error)
indicates that error is coming frompg
rather than Ruby.