It works as intended in both scenarios:
CREATE OR REPLACE TABLE example_table("order" INT); INSERT INTO example_table VALUES (1),(2); SELECT "order" FROM example_table; -- 1 -- 2 SELECT e."order" FROM example_table e; -- 1 -- 2
Most likely there is invisible character used or name is not lowercase as stated in question. When quoting identifier with " it has to be 1:1 as it was created.
Identifier Requirements
If you put double quotes around an identifier (e.g. “My identifier with blanks and punctuation.”), the following rules apply:
The case of the identifier is preserved when storing and resolving the identifier (e.g. "id" is stored and resolved as id).
CREATE OR REPLACE TABLE example_table("Order" INT); INSERT INTO example_table VALUES (1),(2); SELECT "order" FROM example_table; -- Error: invalid identifier '"order"' (line 17) SELECT "Order" FROM example_table; -- 1 -- 2
The "actual" column name could be found using one of the methods described below:
DESCRIBE TABLE example_table; SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME ILIKE 'example_table'; SELECT GET_DDL('table', 'public.example_table'); -- create or replace TABLE EXAMPLE_TABLE ( "Order" NUMBER(38,0) );