To repro:
CREATE TABLE t (a INT PRIMARY KEY);
ALTER TABLE t ADD COLUMN b INT PRIMARY KEY;
Expected: the primary key is b an error is returned (in pg: multiple primary keys for table "t" are not allowed)
Actual: success, and a subsequent SHOW CREATE TABLE t yields
table_name | create_statement
-------------+---------------------------------------------
t | CREATE TABLE public.t (
| a INT8 NOT NULL,
| b INT8 NOT NULL,
| CONSTRAINT t_pkey PRIMARY KEY (a ASC),
| UNIQUE INDEX t_b_key (b ASC)
| )
(1 row)
Jira issue: CRDB-15178
To repro:
Expected:
the primary key isan error is returned (in pg:bmultiple primary keys for table "t" are not allowed)Actual: success, and a subsequent
SHOW CREATE TABLE tyieldsJira issue: CRDB-15178