enable compression in TimeScaleDB hypertable - invalid column name

645 Views Asked by At

When I try and enable compression on my TimeScale DB hypertable using this query:

ALTER TABLE public."Session" SET (
  timescaledb.compress,
  timescaledb.compress_segmentby = 'AssetId'
);

I get the following error:

ERROR:  column "assetid" does not exist
HINT:  The timescaledb.compress_segmentby option must reference a valid column.
SQL state: 42601

All I can say is that AssetId is a valid column in the Session table. I'm not sure what else to try.

Is anybody familiar with this error and could offer a solution please?

Thank you

1

There are 1 best solutions below

0
On BEST ANSWER

Sometimes Postgresql requires the case-sensitive version of the name and therefore the column name was to be quoted.

That said, all you do is to double-quote the name inside the passed string: timescaledb.compress_segmentby = '"AssetId"'