How do I use bind values in a Postgres UPDATE statement?
===

For my UPDATE statement on Postgres (from Perl via DBD::Pg), I want to bind a value like this:

    my $sql = 'UPDATE mytable SET foo = % WHERE id = 42';
    my $foo_value = 23;
    $dbh->do($sql, {}, $foo_value);

This gives the following error in the `do()` line:

    DBD::Pg::db do failed: called with 1 bind variable when 0 are needed at...

I tried other syntaxes for placeholders, `$1` and `?`. Both fail with

    DBD::Pg::db do failed: ERROR:  invalid input syntax for type numeric: "" at...

What is the correct syntax?