-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
sql: Remove type annotations from column_default
in information_schema.columns
#94153
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @e-mbrown and @rafiss)
pkg/sql/logictest/testdata/logic_test/information_schema
line 2073 at r1 (raw file):
query TT colnames select data_type, column_default from information_schema.columns where table_name = 't2' and column_name = 'a';
nit: there's an extra space in front of from
.
pkg/sql/logictest/testdata/logic_test/information_schema
line 4915 at r1 (raw file):
other_db public t2 c 1 other_db public t2 d 2 test public t2 rowid 2
Hmm, this may have revealed another difference from PG. Seems that with postgres this rowid
column won't show up.
postgres=# CREATE TABLE t1(a INT PRIMARY KEY, b BOOLEAN);
CREATE TABLE
postgres=# CREATE TABLE t2(a smallint DEFAULT 0);
CREATE TABLE
postgres=# SELECT table_catalog, table_schema, table_name, column_name, ordinal_position
FROM information_schema.columns where table_name = 't1' OR table_name = 't2';
table_catalog | table_schema | table_name | column_name | ordinal_position
---------------+--------------+------------+-------------+------------------
postgres | public | t2 | a | 1
postgres | public | t1 | a | 1
postgres | public | t1 | b | 2
I can open an issue for this.
…hema .columns` The type annotation on `column_default` caused confusion in postgres compatible apps. This change formats the `column_default` without the type annotation. It does not address the incorrect type annotation. Release note (bug fix): The content of `column_default` in `information_schema.columns` no longer have type annotations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @rafiss and @ZhouXing19)
pkg/sql/logictest/testdata/logic_test/information_schema
line 4915 at r1 (raw file):
Previously, ZhouXing19 (Jane Xing) wrote…
Hmm, this may have revealed another difference from PG. Seems that with postgres this
rowid
column won't show up.postgres=# CREATE TABLE t1(a INT PRIMARY KEY, b BOOLEAN); CREATE TABLE postgres=# CREATE TABLE t2(a smallint DEFAULT 0); CREATE TABLE postgres=# SELECT table_catalog, table_schema, table_name, column_name, ordinal_position FROM information_schema.columns where table_name = 't1' OR table_name = 't2'; table_catalog | table_schema | table_name | column_name | ordinal_position ---------------+--------------+------------+-------------+------------------ postgres | public | t2 | a | 1 postgres | public | t1 | a | 1 postgres | public | t1 | b | 2
I can open an issue for this.
Opening an issue wouldn't hurt.
TFTR Jane! bors r=ZhouXing19 |
Build succeeded: |
Informs: #87774
The type annotation on
column_default
caused confusion in postgres compatible apps. This change formats thecolumn_default
without the type annotation. It does not address the incorrect type annotation.Release note (bug fix): The content of
column_default
ininformation_schema.columns
no longer have type annotations.