insert multiple rows sql for loop postgres code example
Example 1: postgresql insert multiple rows
INSERT INTO table_name (column_list)
VALUES
(value_list_1),
(value_list_2),
...
(value_list_n);
Example 2: sql multiple insert postgres
INSERT INTO User (name, surname, "roomId") // roomId is with quetes("") because it is case sensitive in this example
VALUES
('Joe', 'Travolta', 1),
('Jim', 'Carrey', 2),
('Shakira', 'whenever', 3); // remember about semicolon(;) at the end