By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE TABLE
CREATE FUNCTION
ERROR: column reference "title" is ambiguous LINE 3: ON CONFLICT (title,author) ^ DETAIL: It could refer to either a PL/pgSQL variable or a table column. QUERY: INSERT INTO public.publications VALUES (title,author,another_column) ON CONFLICT (title,author) DO UPDATE SET another_column=EXCLUDED.another_column CONTEXT: PL/pgSQL function upsert_publications(text,text,integer) line 3 at SQL statement
BEGIN
| title | author | another_column |
|---|
SELECT 0
CREATE FUNCTION
| upsert_publications |
|---|
| {"award": "participation_award"} |
SELECT 1
| title | author | another_column |
|---|---|---|
| a | a2 | 0 |
SELECT 1
| upsert_publications |
|---|
| {"award": "participation_award"} |
SELECT 1
| title | author | another_column |
|---|---|---|
| a | a2 | 7 |
SELECT 1
ROLLBACK
START TRANSACTION
| title | author | another_column |
|---|
SELECT 0
CREATE FUNCTION
| upsert_publications |
|---|
| {"award": "participation_award"} |
SELECT 1
| title | author | another_column |
|---|---|---|
| a | a2 | 0 |
SELECT 1
| upsert_publications |
|---|
| {"award": "participation_award"} |
SELECT 1
| title | author | another_column |
|---|---|---|
| a | a2 | 7 |
SELECT 1
ROLLBACK