dolthub / dolthub/doltgresql

Support `excluded` table alias in `INSERT ... ON CONFLICT`

Open
#1,258 1 comment 0 reactions 0 assignees View on GitHub
data import enhancement
Dominant language
Go
Stars
2.1k
Forks
73
Avg merge
1d 11h
Merged PRs (30d)
152

Description

The `ON CONFLICT` clause of the `INSERT` statement implicitly provides a table alias named `excluded` that represents the row proposed for insertion.

Example:
```sql
INSERT INTO distributors (did, dname)
VALUES (5, 'Gizmo Transglobal'), (6, 'Associated Computing, Inc')
ON CONFLICT (did) DO UPDATE SET dname = EXCLUDED.dname;
```

[PostgreSQL Docs](https://www.postgresql.org/docs/current/sql-insert.html)

Found while testing DoltHub postgres schema.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.