Skip to content
Advertisement

enable compression in TimeScaleDB hypertable – invalid column name

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

Advertisement

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"'

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement