Rename conflicted column (postgres)

I am having a bit of trouble getting this to work.

await db
      .insert(schema.listings)
      .values(listings)
      .onConflictDoUpdate({
        target: schema.listings.SKU,
        set: {
          SKU: sql`CONCAT(EXCLUDED.${schema.listings.SKU.name}, '-duplicate')`,
        },
      });


Error I get

 Uncaught (in promise) PostgresError: syntax error at or near "$601"
Was this page helpful?