Subject: [PATCH] Add support for INSERT ... SET syntax

From: Suraj Kharage <[email-masked]>
Date: Mon, 30 Mar 2026 16:34:27 +0530

Hi,

I would like to propose adding support for an alternative INSERT syntax
that uses named column assignments via a SET clause. This provides a more
convenient and readable way to write inserts, particularly when only
specific columns need values.

Currently, PostgreSQL requires INSERT statements to separate the column
list from the values:

    INSERT INTO users (name, email, status) VALUES ('Alice', '
[email-masked]', 'active');

For inserts with many columns or where only a subset of columns are
specified, the proposed SET syntax offers better readability by keeping
column names adjacent to their values:

    INSERT INTO users SET name='Alice', email=[email-masked]',
status='active';

Proposed Syntax:

    INSERT INTO table_name
        SET (column1=value1, column2=value2, ...), (, ...)
        [ ON CONFLICT ... ]
        [ RETURNING ... ];

Below INSERT features are supported:
- DEFAULT keyword: SET col=DEFAULT
- Expressions and functions: SET col=expr, col2=function(...)
- Subqueries: SET col=(SELECT ...)
- RETURNING clause
- ON CONFLICT DO UPDATE/NOTHING
- OVERRIDING SYSTEM VALUE
- Multi-row syntax: SET (col1=val1, col2=val2), (col1=val3, col2=val4)

Columns not mentioned receive their default values or NULL, consistent with
standard INSERT behavior.

I've attached the patch. Looking forward to your feedback.
--

Thanks & Regards,
Suraj kharage,

enterprisedb.com <https://www.enterprisedb.com/>

---

From: "David G. Johnston" <[email-masked]>
Date: Mon, 30 Mar 2026 07:38:27 -0700

> specific columns need values.

-1 for inventing our own full variant of insert command syntax.

David J.