Templog Log
Templog Log

Reputation: 415

How to reduce multiple insert into in postgresql?

is it possible to reduce a multiple insert into in PostgreSQL.

i have this:

insert into table (id,name,city)
values ('1','Mike','Orleans')

insert into table (id,name,city)
values ('2','Paul','Paris')

so i have to insert more than 100 datas. Can we do it in one query

Thank you

Upvotes: 0

Views: 30

Answers (1)

user330315
user330315

Reputation:

insert into the_table (id,name,city)
values 
  (1,'Mike','Orleans'),
  (2,'Paul','Paris');

If id is an integer column, then don't provide a string value for it. '1' is a string (character) value. Numbers are specified without single quotes: 1 is a number.

Upvotes: 1

Related Questions