dolthub / doltgresql

DoltgreSQL - Version Controlled PostgreSQL
Apache License 2.0
1.07k stars 23 forks source link

Add support for `ALTER COLUMN TYPE`, `DEFAULT`, and `NOT NULL` statements #789

Closed fulghum closed 3 days ago

fulghum commented 4 days ago

Depends on:

github-actions[bot] commented 3 days ago
Main PR
Total 42090 42090
Successful 12375 12414
Failures 29715 29676
Partial Successes[^1] 4915 4907
Main PR
Successful 29.4013% 29.4939%
Failures 70.5987% 70.5061%

Progressions

alter_table

QUERY: alter table atacc1 alter test_a drop not null;
QUERY: alter table parent alter a set not null;
QUERY: alter table parent alter a drop not null;
QUERY: alter table def_test alter column c1 drop default;
QUERY: alter table def_test alter column c2 drop default;
QUERY: alter table def_test alter column c1 set default 10;
QUERY: alter table def_test alter column c2 set default 'new_default';
QUERY: alter table def_test alter column c2 set default 20;
QUERY: alter table anothertab alter column atcol1 drop default;
QUERY: alter table anothertab alter column f1 type bigint;
QUERY: alter table anothertab alter column f5 type bigint;
QUERY: alter table skip_wal_skip_rewrite_index alter c type varchar(20);
QUERY: alter table alterlock alter column f2 set default 'x';
QUERY: ALTER TABLE IF EXISTS tt8 ALTER COLUMN f SET DEFAULT 0;
QUERY: alter table atref alter column c1 set data type bigint;
QUERY: alter table atref alter column c1 set data type bigint;
QUERY: alter table alttype_cluster alter a type bigint;
QUERY: alter table alttype_cluster alter a type int;

compression

QUERY: ALTER TABLE cmdata2 ALTER COLUMN f1 TYPE varchar;
QUERY: ALTER TABLE cmdata2 ALTER COLUMN f1 TYPE varchar;
QUERY: INSERT INTO cmdata2 VALUES (repeat('123456789', 800));

create_table

QUERY: ALTER TABLE remember_node_subid ALTER c TYPE bigint;

dependency

QUERY: ALTER TABLE deptest2 ALTER f1 SET DEFAULT nextval('ss1');

event_trigger

QUERY: alter table rewriteme alter column foo type numeric(12,4);
QUERY: alter table rewriteme alter column bar type timestamp;
QUERY: alter table rewriteme alter column bar type timestamptz;
QUERY: alter table rewriteme alter column bar type timestamp;

fast_default

QUERY: ALTER TABLE vtype2 ALTER COLUMN b SET DEFAULT 'yyy';

foreign_key

QUERY: ALTER TABLE pk2 ALTER a SET NOT NULL;

Regressions

identity

QUERY:          INSERT INTO itest14 (id) VALUES (DEFAULT);
RECEIVED ERROR: runtime error: invalid memory address or nil pointer dereference

identity

QUERY: ALTER TABLE itest4 ALTER COLUMN a SET NOT NULL;
QUERY: ALTER TABLE itest4 ALTER COLUMN b SET DEFAULT '';
QUERY: ALTER TABLE itest3 ALTER COLUMN a TYPE int;
QUERY: ALTER TABLE itest14 ALTER id DROP DEFAULT;

indexing

QUERY: alter table pk2 alter a set not null;

publication

QUERY: ALTER TABLE rf_tbl_abcd_pk ALTER COLUMN c SET NOT NULL;
QUERY: ALTER TABLE rf_tbl_abcd_nopk ALTER COLUMN c SET NOT NULL;
QUERY: ALTER TABLE rf_tbl_abcd_pk ALTER COLUMN c SET NOT NULL;
QUERY: ALTER TABLE rf_tbl_abcd_nopk ALTER COLUMN c SET NOT NULL;

replica_identity

QUERY: ALTER TABLE test_replica_identity2 ALTER COLUMN id TYPE bigint;
QUERY: ALTER TABLE test_replica_identity3 ALTER COLUMN id TYPE bigint;

tablespace

QUERY: ALTER TABLE testschema.tablespace_acl ALTER c TYPE bigint;

updatable_views

QUERY: alter table uv_iocu_tab alter column b set default 'table default';

[^1]: These are tests that we're marking as Successful, however they do not match the expected output in some way. This is due to small differences, such as different wording on the error messages, or the column names being incorrect while the data itself is correct.