Updating existing record using redshift sql(primary key issue)

getting this error while update the record, how i can exlude ID from update records.
update "retool"."extracharges_rt" set "id" = $1, "log_date" = $2, "charge_week" = $3, "drn" = $4, "names" = $5, "car_reg" = $6, "city" = $7, "issue_type" = $8, "charge_amount" = $9, "reason" = $10, "approved" = $11, "approval_date" = $12, "comment" = $13 where "id" = $14 - cannot set an identity column to a value

Did you find the solution for this?

Hi @Niraj_Gupta, happy to help! :slightly_smiling_face:
Have you tried not including the id in the SET statement?

Something like:

UPDATE "retool"."extracharges_rt"
SET
  "log_date" = $1,
  "charge_week" = $2,
  "drn" = $3,
  "names" = $4,
  "car_reg" = $5,
  "city" = $6,
  "issue_type" = $7,
  "charge_amount" = $8,
  "reason" = $9,
  "approved" = $10,
  "approval_date" = $11,
  "comment" = $12
WHERE
  "id" = $13;   ---> We can pass the id as the last argument to find the record to update.