0

I'm trying to display hypertable information but can't seem to access the information table.

This request succeeds

select * from _timescaledb_catalog.hypertable;

But this one doesn't, says the table doesn't exist:

select * from timescaledb_information.hypertable;

As expected, creating a hypertable doesn't make any difference.

The former command was found in https://github.com/timescale/timescaledb/issues/648 and I would understand if it was obsolete as the user refers to the 0.10 docs.

The latter comes from the docs: https://docs.timescale.com/latest/api#utilities so it should work.

I'm using Timescale DB 2.2.0 (official Timescale repos) with PostgreSQL 11 (Debian repos).

Jérôme
  • 13,328
  • 7
  • 56
  • 106

1 Answers1

7

timescaledb_information.hypertable is old name for this information view. From 2.0 all information views use plural instead of singular in the names. So this information view is renamed to timescaledb_information.hypertables. Its definition was updated too, see it in the docs.

The following query should work in 2.2.0:

select * from timescaledb_information.hypertables;

I also suggest to check the overall changes in 2.0.

k_rus
  • 2,959
  • 1
  • 19
  • 31
  • I'm running 2.0 already. I just dropped a DB, recreated it from scratch, created timescaledb extension. It read "Running version 2.1.0" under the ASCII art logo. Still, I'm getting `_timescaledb_catalog` but not `timescaledb_information`. – Jérôme Apr 14 '21 at 11:03
  • @Jérôme Do you write `timescaledb_information.hypertable` or `timescaledb_information.hypertables`? Note plural in the second case. What error do you get? – k_rus Apr 14 '21 at 11:54
  • @Jérôme What do you get from `\dv`? – k_rus Apr 14 '21 at 11:56
  • Oh boy. The plural was the issue. I must have copied from an outdated source. I even missed it in your answer, sorry about that. It works with the plural. Thanks. – Jérôme Apr 14 '21 at 12:45
  • This question could be deleted or closed as typo but since singular is an old name, someone else might fall into it so I'm leaving it. – Jérôme Apr 14 '21 at 12:46
  • For completeness, `_timescaledb_catalog.hypertable` is a table, `timescaledb_information.hypertables` is a view. Both are listed by `\dt *.*` and `\dv *.*` respectively. – Jérôme Apr 14 '21 at 12:48