PostgreSQL ERROR: INSERT has more target columns than expressions, when it doesn’t

Remove the extra () :

INSERT INTO parts_finishing 
(
 id_part, id_finish, id_metal, id_description, 
 date, inside_hours_k, inside_rate, outside_material
) VALUES 
  ('1013', '6', '30', '1', NOW(), '0', '0', '22.43')
, ('1013', '6', '30', '2', NOW(), '0', '0', '32.45')
  ;

the (..., ...) in Postgres is the syntax for a tuple literal; The extra set of ( ) would create a tuple of tuples, which makes no sense.

Also: for numeric literals you don’t want the quotes:

(1013, 6, 30, 1, NOW(), 0, 0, 22.43)
, ...

, assuming all these types are numerical.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)