MERGE INTO 
    rlarp.walk_r1 w
USING 
    ( SELECT $1 bill_cust, $2 ship_cust, $3 bucket, $4 attainment, $5 notes) as i ON
        i.ship_cust = w.ship_cust
        AND i.bill_cust = w.bill_cust
WHEN MATCHED THEN UPDATE SET 
    bucket = i.bucket
    ,attainment = i.attainment::numeric
    ,notes = i.notes
WHEN NOT MATCHED THEN 
    INSERT (bill_cust, ship_cust, bucket, attainment, notes)
    VALUES (bill_cust,i.ship_cust, i.bucket, i.attainment::numeric, i.notes )
