ALTER TABLE "FinalProduct"
ADD COLUMN IF NOT EXISTS "inch" DOUBLE PRECISION;

UPDATE "FinalProduct"
SET "inch" = CASE
  WHEN "code" ~ '^[0-9]' THEN CAST(SUBSTRING("code" FROM 1 FOR 1) AS DOUBLE PRECISION)
  ELSE NULL
END;
