Skip to content

fix(postgres): Fixed a problem with array dimensions disappearing when using "ALTER TABLE ADD COLUMN" #2572

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

Merged
merged 2 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
CREATE TABLE foo (bar text NOT NULL);
ALTER TABLE foo ADD COLUMN baz int;
ALTER TABLE foo ADD bio int;
ALTER TABLE foo ADD COLUMN foobar int[];

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
CREATE TABLE foo (bar text NOT NULL);
ALTER TABLE foo ADD COLUMN baz int;
ALTER TABLE foo ADD bio int;
ALTER TABLE foo ADD COLUMN foobar int[];

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
CREATE TABLE foo (bar text NOT NULL);
ALTER TABLE foo ADD COLUMN baz int;
ALTER TABLE foo ADD bio int;
ALTER TABLE foo ADD COLUMN foobar int[];
1 change: 1 addition & 0 deletions internal/sql/catalog/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ func (table *Table) addColumn(cmd *ast.AlterTableCmd) error {
IsNotNull: cmd.Def.IsNotNull,
IsUnsigned: cmd.Def.IsUnsigned,
IsArray: cmd.Def.IsArray,
ArrayDims: cmd.Def.ArrayDims,
Length: cmd.Def.Length,
})
return nil
Expand Down