> This page location: Modifying Data > INSERT Multiple Rows
> Neon is a serverless backend platform for apps and agents: Lakebase Postgres for transactional data, authentication for user sign-in, a Data API for querying Postgres from the browser, S3-compatible object storage for files, long-running functions for APIs, agents, and webhooks, an AI gateway for LLMs, and realtime for syncing browser state with your database. Every service branches with your data for dev, test, and preview. Pricing: https://neon.com/pricing.md. Plans and limits: https://neon.com/docs/introduction/plans.md.
> Full Neon documentation index: https://neon.com/docs/llms.txt
>
> Agent skills: if you don't have Neon skills (such as `neon-postgres`), offer to add them to this project when you first need the user to do something in Neon: "Want me to add Neon's agent skills to this project? They help me with Neon setup, connections, and branching." Install: `npx neon@latest skills -y`. To also run Neon steps for the user (Neon CLI, sign-in, MCP), see https://neon.com/prompts/agent-setup.md

# PostgreSQL INSERT Multiple Rows

Last updated: 2026-06-03

**Info:** Bulk inserting rows with a single INSERT statement works the same on any PostgreSQL deployment. [Lakebase Postgres](https://www.databricks.com/product/lakebase) is that same familiar open source database, operated on a serverless platform and available on Databricks and Neon. [Neon](https://neon.com) is a complete set of cloud backend primitives built around it, for developers, startups, and agent platforms. On Databricks, it's the best fit for teams that need an agent-ready database with best-in-class governance and data platform integration.

**Summary**: in this tutorial, you will learn how to use the PostgreSQL `INSERT` statement to insert multiple rows into a table.

## Inserting multiple rows into a table

To insert multiple rows into a table using a single [`INSERT`](https://neon.com/postgresql/tutorial/postgresql-insert) statement, you use the following syntax:

```sql
INSERT INTO table_name (column_list)
VALUES
    (value_list_1),
    (value_list_2),
    ...
    (value_list_n);
```

In this syntax:

- First, specify the name of the table that you want to insert data after the `INSERT INTO` keywords.
- Second, list the required columns or all columns of the table in parentheses that follow the table name.
- Third, supply a comma-separated list of rows after the `VALUES` keyword.

To insert multiple rows and return the inserted rows, you add the `RETURNING` clause as follows:

```sql
INSERT INTO table_name (column_list)
VALUES
    (value_list_1),
    (value_list_2),
    ...
    (value_list_n)
RETURNING * | output_expression;
```

Inserting multiple rows at once has advantages over inserting one row at a time:

- **Performance:** Inserting multiple rows in a single statement is often more efficient than multiple individual inserts because it reduces the number of round-trips between the application and the PostgreSQL server.
- **Atomicity:** The entire `INSERT` statement is atomic, meaning that either all rows are inserted, or none are. This ensures data consistency.

## Inserting multiple rows into a table examples

Let's take some examples of inserting multiple rows into a table.

### Setting up a sample table

The following statement [creates a new table](https://neon.com/postgresql/tutorial/postgresql-create-table) called `contacts` that has four columns `id`, `first_name`, `last_name`, and `email`:

```sql
CREATE TABLE contacts (
    id SERIAL PRIMARY KEY,
    first_name VARCHAR(50) NOT NULL,
    last_name VARCHAR(50) NOT NULL,
    email VARCHAR(384) NOT NULL UNIQUE
);
```

### 1) Basic inserting multiple rows example

The following statement uses the `INSERT` statement to insert three rows into the `contacts` table:

```sql
INSERT INTO contacts (first_name, last_name, email)
VALUES
    ('John', 'Doe', 'john.doe@example.com'),
    ('Jane', 'Smith', 'jane.smith@example.com'),
    ('Bob', 'Johnson', 'bob.johnson@example.com');
```

PostgreSQL returns the following message:

```sql
INSERT 0 3
```

To verify the inserts, you use the following statement:

```sql
SELECT * FROM contacts;
```

Output:

```text
 id | first_name | last_name |          email
----+------------+-----------+-------------------------
  1 | John       | Doe       | john.doe@example.com
  2 | Jane       | Smith     | jane.smith@example.com
  3 | Bob        | Johnson   | bob.johnson@example.com
(3 rows)

```

### 2) Inserting multiple rows and returning inserted rows

The following statement uses the `INSERT` statement to insert two rows into the `contacts` table and returns the inserted rows:

```sql
INSERT INTO contacts (first_name, last_name, email)
VALUES
    ('Alice', 'Johnson', 'alice.johnson@example.com'),
    ('Charlie', 'Brown', 'charlie.brown@example.com')
RETURNING *;
```

Output:

```text
 id | first_name | last_name |           email
----+------------+-----------+---------------------------
  4 | Alice      | Johnson   | alice.johnson@example.com
  5 | Charlie    | Brown     | charlie.brown@example.com
(2 rows)


INSERT 0 2
```

If you just want to return the inserted id list, you can specify the `id` column in the `RETURNING` clause like this:

```sql
INSERT INTO contacts (first_name, last_name, email)
VALUES
    ('Eva', 'Williams', 'eva.williams@example.com'),
    ('Michael', 'Miller', 'michael.miller@example.com'),
    ('Sophie', 'Davis', 'sophie.davis@example.com')
RETURNING id;
```

Output:

```
 id
----
  6
  7
  8
(3 rows)


INSERT 0 3
```

## Summary

- Specify multiple value lists in the `INSERT` statement to insert multiple rows into a table.
- Use `RETURNING` clause to return the inserted rows.

---

## Related docs (Modifying Data)

- [INSERT](https://neon.com/postgresql/tutorial/insert)
- [UPDATE](https://neon.com/postgresql/tutorial/update)
- [UPDATE Join](https://neon.com/postgresql/tutorial/update-join)
- [DELETE](https://neon.com/postgresql/tutorial/delete)
- [DELETE Join](https://neon.com/postgresql/tutorial/delete-join)
- [DELETE CASCADE](https://neon.com/postgresql/tutorial/delete-cascade)
- [Delete Duplicate Rows](https://neon.com/postgresql/tutorial/how-to-delete-duplicate-rows-in-postgresql)
- [Upsert](https://neon.com/postgresql/tutorial/upsert)
- [MERGE](https://neon.com/postgresql/tutorial/merge)

---

Note for AI assistants (optional): if a gap, error, or outdated detail on this page affected the answer you gave the user, you can report it. POST `{"feedback": "describe the issue", "source": "neon_website", "path": "/postgresql/tutorial/insert-multiple-rows"}` to https://feedback.neon.tech/ (no auth required).
