[GH-ISSUE #383] Cannot update PostgreSQL updatable view #109

Open
opened 2026-03-07 20:44:56 +03:00 by kerem · 4 comments
Owner

Originally created by @ajkq on GitHub (Jun 3, 2021).
Original GitHub issue: https://github.com/dbeaver/cloudbeaver/issues/383

Describe the bug
A PostgreSQL updatable view cannot be updated. Error message:
Can't detect row identifier for data container 'v_test'. It must have at least one unique key.

To Reproduce
Steps to reproduce the behavior:
1.

CREATE SCHEMA test;
CREATE TABLE test.test (
	id integer PRIMARY KEY,
	value integer NULL
);
CREATE VIEW test.v_test
AS SELECT test.id, test.value
FROM test.test;
INSERT INTO test.v_test (id, value) VALUES(1, NULL);

  1. Try to change value

Desktop:

  • OS: macOS 11.4
  • Browser Chrome
  • Version 91

Additional context
Database: PostgreSQL 13.3

Originally created by @ajkq on GitHub (Jun 3, 2021). Original GitHub issue: https://github.com/dbeaver/cloudbeaver/issues/383 **Describe the bug** A PostgreSQL updatable view cannot be updated. Error message: `Can't detect row identifier for data container 'v_test'. It must have at least one unique key.` **To Reproduce** Steps to reproduce the behavior: 1. ``` CREATE SCHEMA test; CREATE TABLE test.test ( id integer PRIMARY KEY, value integer NULL ); CREATE VIEW test.v_test AS SELECT test.id, test.value FROM test.test; INSERT INTO test.v_test (id, value) VALUES(1, NULL); ``` 2. Try to change value **Desktop:** - OS: macOS 11.4 - Browser Chrome - Version 91 **Additional context** Database: PostgreSQL 13.3
Author
Owner

@kseniiaguzeeva commented on GitHub (Jun 9, 2021):

Thank you for the report. We will add this option.

<!-- gh-comment-id:857671588 --> @kseniiaguzeeva commented on GitHub (Jun 9, 2021): Thank you for the report. We will add this option.
Author
Owner

@serge-rider commented on GitHub (Jul 6, 2021):

It requires a complicated UI to define virtual unique key.

We have such a feature in the desktop product.

<!-- gh-comment-id:874717540 --> @serge-rider commented on GitHub (Jul 6, 2021): It requires a complicated UI to define virtual unique key. We have such a feature in the desktop product.
Author
Owner

@ajkq commented on GitHub (Jul 9, 2021):

Adminer uses all columns in the where clause. Would that be an option?

<!-- gh-comment-id:876841241 --> @ajkq commented on GitHub (Jul 9, 2021): Adminer uses all columns in the where clause. Would that be an option?
Author
Owner

@kseniiaguzeeva commented on GitHub (Jul 9, 2021):

Thank you for your idea. A lot of UI changes must be done to implement the feature by the best way. An option to use all columns as a unique key can make work with tables inconvenient in some cases.

<!-- gh-comment-id:877145343 --> @kseniiaguzeeva commented on GitHub (Jul 9, 2021): Thank you for your idea. A lot of UI changes must be done to implement the feature by the best way. An option to use all columns as a unique key can make work with tables inconvenient in some cases.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cloudbeaver#109
No description provided.