1

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

jim
  • 8,670
  • 15
  • 78
  • 149
  • Not sure but a first guess would be `timescaledb.compress_segmentby = '"AssetId"'`? But just a wild guess Otherwise can you provide the table schema? – noctarius Nov 24 '22 at 15:37
  • Ok that appears to have worked.. feel free to answer the question and I'll accept. I remember trying the quotes the other way around. I don't remember PG being this awkward last time around.. anyway thank you a lot. – jim Nov 24 '22 at 15:50
  • I don't remember when you have to quote mixed case column names, maybe it was case-sensitive file systems? Anyhow. Happy it worked. Let me make it an answer – noctarius Nov 25 '22 at 07:09

1 Answers1

1

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

noctarius
  • 5,979
  • 19
  • 20