PostgreSQL INSERT INTO
Overview
The INSERT statement adds new rows to a PostgreSQL table. This chapter covers various ways to insert data, including single rows, multiple rows, and inserting from other tables.
INSERT Syntax
Basic INSERT Operations
Single Row
Multiple Rows
INSERT with SELECT
Conflict Handling
Basic ON CONFLICT
ON CONFLICT with WHERE
INSERT with RETURNING
Summary
INSERT in PostgreSQL includes:
- Basic INSERT, Multiple rows
- INSERT with SELECT
- ON CONFLICT for upsert operations
- RETURNING clause for results