GoogleCloudPlatform / GoogleCloudPlatform/cloud-spanner-emulator

PostgreSQL "ON CONFLICT" and table in schema

Open
#312 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
334
Forks
77
Avg merge
8m
Merged PRs (30d)
2

Description

Attempting to use "ON CONFLICT" with a table in a schema results in a "Table not found" error.

```
=> create schema temp_schema;
CREATE

=> create table temp_schema.widget(widget_id int not null primary key, name text not null);
CREATE

=> insert into temp_schema.widget(widget_id, name) values (1, 'name 1') on conflict (widget_id) do update set name = EXCLUDED.name RETURNING name;
ERROR: Table not found: widget - Statement: 'insert into temp_schema.widget(widget_id, name) values (1, 'name 1') on conflict (widget_id) do update set name = EXCLUDED.name RETURNING name'

=> insert into temp_schema.widget(widget_id, name) values (1, 'name 1');
INSERT 0 1

=> insert into temp_schema.widget(widget_id, name) values (1, 'name 2') on conflict (widget_id) do update set name = EXCLUDED.name RETURNING name;
ERROR: Table not found: widget - Statement: 'insert into temp_schema.widget(widget_id, name) values (1, 'name 2') on conflict (widget_id) do update set name = EXCLUDED.name RETURNING name'

=> insert into temp_schema.widget(widget_id, name) values (1, 'name 2') on conflict (widget_id) do nothing;
ERROR: Table not found: widget
```

Works in <=1.5.43

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.