You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In PostgreSQL all column name identifiers are turned into lowercase, unless they are quoted. Example:
tmp1=> create table blah (Foo int, "Foo" int, "Bar" int);
CREATE TABLE
tmp1=> \d blah
Table "public.blah"
Column | Type | Collation | Nullable | Default
--------+---------+-----------+----------+---------
foo | integer | | |
Foo | integer | | |
Bar | integer | | |
tmp1=> insert into blah values (1,2,3);
INSERT 0 1
tmp1=> select foo, Foo, "Foo", "Bar" from blah;
foo | foo | Foo | Bar
-----+-----+-----+-----
1 | 1 | 2 | 3
(1 row)
tmp1=> select Bar from blah;
ERROR: column "bar" does not exist
LINE 1: select Bar from blah;
^
HINT: Perhaps you meant to reference the column "blah.Bar".
PostgreSQL converts to lowercase all column identifiers. The example above shows how Foo used in the DDL statement creates a column actually named foo and it shows how it can be accessed in a query with Foo (unquoted). An actual "Foo" column happily coexist with foo in the table, but must be referenced with a quoted "Foo"
In Datafusion currently Bar means the same as "Bar" (I'm not providing a screen dump of the current datafusion behaviour out of laziness, I may add it later if turns out to be useful for the discussion).
Describe the solution you'd like
select FoO from my_table;
should be equivalent to
select foo from my_table;
If users want to access a column that is not in lower case, they should explicitly quote the column:
select "FoO" from my_table;
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
In PostgreSQL all column name identifiers are turned into lowercase, unless they are quoted. Example:
PostgreSQL converts to lowercase all column identifiers. The example above shows how
Foo
used in the DDL statement creates a column actually namedfoo
and it shows how it can be accessed in a query withFoo
(unquoted). An actual"Foo"
column happily coexist withfoo
in the table, but must be referenced with a quoted"Foo"
In Datafusion currently
Bar
means the same as"Bar"
(I'm not providing a screen dump of the current datafusion behaviour out of laziness, I may add it later if turns out to be useful for the discussion).Describe the solution you'd like
should be equivalent to
If users want to access a column that is not in lower case, they should explicitly quote the column:
The text was updated successfully, but these errors were encountered: