Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[YSQL] Support updating primary key columns #659

Closed
nocaway opened this issue Dec 12, 2018 · 2 comments
Closed

[YSQL] Support updating primary key columns #659

nocaway opened this issue Dec 12, 2018 · 2 comments
Assignees
Labels
area/ysql Yugabyte SQL (YSQL) kind/enhancement This is an enhancement of an existing feature
Projects
Milestone

Comments

@nocaway
Copy link
Contributor

nocaway commented Dec 12, 2018

Fix for issue #565 only support UPDATE attributes that are not PRIMARY KEY column.
In YugaByte, updating PRIMARY KEY columns needs special attention because they are currently used for two important purposes.

  • Partitioning the table.
  • Ordering rows within one table.
@nocaway nocaway added the kind/enhancement This is an enhancement of an existing feature label Dec 12, 2018
@nocaway nocaway added this to To do in YSQL via automation Dec 12, 2018
@nocaway
Copy link
Contributor Author

nocaway commented Jan 15, 2019

Test case
1- Create a table.
--- CREATE TABLE tab(id int primary key, name text);
2- Insert 100 rows into table.
--- INSERT INTO tab VALUES(x, 'x'); where x = {1, 2, ..., 100 }
3- Update rows
--- UPDATE tab SET id = id + 1000;
4- Turn OFF prefetch by change kPrefetchLimit to 1
--- File pg_doc_op.h: static const int64_t kPrefetchLimit = 1;
--- Also, it's a mistake to use INT32_MAX as default value for number of prefetched rows. We should use "1024" instead.

@schoudhury schoudhury added the area/ysql Yugabyte SQL (YSQL) label Apr 17, 2020
@rkarthik007 rkarthik007 added this to the v2.2 milestone Apr 17, 2020
@ndeodhar ndeodhar changed the title [YSQL] UPDATE PRIMARY KEY support in PostgreSQL [YSQL] Support updating primary key columns Apr 28, 2020
@ndeodhar ndeodhar assigned frozenspider and unassigned mbautin and ndeodhar Apr 28, 2020
@frozenspider frozenspider moved this from To do to In progress in YSQL May 29, 2020
@sergeyshaykhullin
Copy link

+1

YSQL automation moved this from In progress to Done Aug 3, 2020
frozenspider added a commit that referenced this issue Aug 13, 2020
… partition, fixed test

Summary:
* Updating primary keys (#659) and row-level partitioning (#5179) were developed concurrently. As a result, `yb_pg_foreign_key` pg_regress test had a semantic merge conflict. This test has been fixed, using the vanilla `foreign_key` test as a reference.
* UPDATE on a partitioned table is not allowed to change a partition (#5310 is tracking this). This is handled correctly, but an error message didn't make it clear what went wrong. That message has been improved.

Test Plan: ybd --java-test 'org.yb.pgsql.TestPgForeignKey#testPgRegress'

Reviewers: dmitry, jason

Reviewed By: jason

Subscribers: mikhail, yql

Differential Revision: https://phabricator.dev.yugabyte.com/D9146
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL) kind/enhancement This is an enhancement of an existing feature
Projects
YSQL
  
Done
Development

No branches or pull requests

7 participants