Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

convert to columnar table does not support case-sensitive table names #264

Closed
pantonis opened this issue May 20, 2024 · 11 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@pantonis
Copy link

What's wrong?

when we run this

SELECT columnar.alter_table_set_access_method('dw."AccountSummaryFact"', 'columnar');

we can see that table is not converted to columnar

@pantonis pantonis added the bug Something isn't working label May 20, 2024
@wuputah
Copy link
Member

wuputah commented May 20, 2024

I believe this function was updated to be case sensitive, so you should be able to do:

SELECT columnar.alter_table_set_access_method('dw.AccountSummaryFact', 'columnar');

@wuputah wuputah changed the title Columnar table is not created when specifying schema convert to columnar table does not support case-sensitive table name with quotes May 20, 2024
@wuputah
Copy link
Member

wuputah commented May 20, 2024

the referenced fix is in 1.1.2, see #237.

@pantonis
Copy link
Author

pantonis commented May 20, 2024

Yes I have checked the code as well. and saw that change. But still doesnt work even with your suggestion above

SELECT columnar.alter_table_set_access_method('dw.AccountSummaryFact', 'columnar');

Table dw.accountsummaryfact does not exist.

@wuputah
Copy link
Member

wuputah commented May 20, 2024

can you show me the output from

select * from pg_available_extensions where name = 'columnar';

@pantonis
Copy link
Author

columnar 11.1-11 11.1-11 Hydra Columnar extension

@wuputah wuputah changed the title convert to columnar table does not support case-sensitive table name with quotes convert to columnar table does not support case-sensitive table names May 20, 2024
@wuputah
Copy link
Member

wuputah commented May 20, 2024

Confirmed against ghcr.io/hydradatabase/hydra:latest as follows:

create schema "FooBar";
create table "FooBar"."BazQux" (i1 integer) using heap;
select columnar.alter_table_set_access_method('FooBar.BazQux', 'columnar');
CREATE SCHEMA
CREATE TABLE
WARNING:  Table foobar.bazqux does not exist.
 alter_table_set_access_method
-------------------------------
 f
(1 row)

Additionally if you quote everything:

select columnar.alter_table_set_access_method('"FooBar"."BazQux"', 'columnar');
ERROR:  table "BazQux" does not exist
CONTEXT:  SQL statement "DROP TABLE "BazQux""
PL/pgSQL function columnar.alter_table_set_access_method(text,text) line 128 at EXECUTE

mkaruza added a commit that referenced this issue May 21, 2024
* We should be able to convert case sensitive schema name and table
  names. For case sensitive names function argument for
  `alter_table_set_access_method` should be like "Schema"."Table".
@pantonis
Copy link
Author

what is the release date for 11.1-12?

mkaruza added a commit that referenced this issue May 21, 2024
* We should be able to convert case sensitive schema name and table
  names. For case sensitive names function argument for
  `alter_table_set_access_method` should be like "Schema"."Table".
@mkaruza
Copy link
Contributor

mkaruza commented May 21, 2024

Just to comment for future references. When schema and/or table should be case sensitive function argument should be provided like:

select columnar.alter_table_set_access_method('"FooBar"."BazQux"', 'columnar');

@pantonis
Copy link
Author

This is what we expected actually but it didnt work. Can you please provide an estimate for release?

@mkaruza
Copy link
Contributor

mkaruza commented May 21, 2024

@wuputah Can you give estimate ?

wuputah pushed a commit that referenced this issue May 21, 2024
* We should be able to convert case sensitive schema name and table
  names. For case sensitive names function argument for
  `alter_table_set_access_method` should be like "Schema"."Table".
@wuputah
Copy link
Member

wuputah commented May 21, 2024

Unless you're running on Hydra Cloud, there is no need to wait for a release. You can copy-paste the updated function to your own instance to apply the fix. This won't break future upgrades, as when the update is applied later, it will just replace it again, which will have no effect.

If you need this fix on your instance of Hydra Cloud, please contact support.

@wuputah wuputah closed this as completed May 21, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants