hydradatabase / hydra

Hydra: Column-oriented Postgres. Add scalable analytics to your project in minutes.
https://www.hydra.so
Apache License 2.0
2.8k stars 73 forks source link

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

Closed pantonis closed 3 months ago

pantonis commented 3 months ago

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

wuputah commented 3 months ago

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 commented 3 months ago

the referenced fix is in 1.1.2, see #237.

pantonis commented 3 months ago

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 commented 3 months ago

can you show me the output from

select * from pg_available_extensions where name = 'columnar';
pantonis commented 3 months ago

columnar 11.1-11 11.1-11 Hydra Columnar extension

wuputah commented 3 months ago

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
pantonis commented 3 months ago

what is the release date for 11.1-12?

mkaruza commented 3 months ago

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 commented 3 months ago

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

mkaruza commented 3 months ago

@wuputah Can you give estimate ?

wuputah commented 3 months ago

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.