Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong result returned by hypertable_size if no privileges granted on foreign servers #3698

Closed
erimatnor opened this issue Oct 15, 2021 · 0 comments · Fixed by #3701
Closed

Comments

@erimatnor
Copy link
Contributor

Relevant system information:

TimescaleDB 2.4

Describe the bug

Calling hypertable_size on a distributed hypertable with no priviliges on the foreign servers returns weird result:

Without privileges:

tsdb=> SELECT COALESCE(hypertable_size, 0) AS size FROM hypertable_size('"public"."disttable"');
 size
-------
 57344
(1 row)

With privileges:

tsdb=# SELECT COALESCE(hypertable_size, 0) AS size FROM hypertable_size('"public"."disttable"');
 size
------
 8192
(1 row)

To Reproduce
See above.

Expected behavior
The hypertable_size function should raise an error if privileges are missing.

Actual behavior
The function returns the wrong result.

erimatnor added a commit to erimatnor/timescaledb that referenced this issue Oct 15, 2021
This change removes a check for `USAGE` privileges on data nodes
required to query the data node using utility commands, such as
`hypertable_size`. Normally, PostgreSQL doesn't require `USAGE` on a
foreign server to query its remote tables. Also, size utilities, like
`pg_table_size` can be used by anyone---even roles without any
privileges on a table. The behavior on distributed hypertables is now
consistent with PostgreSQL.

Fixes timescale#3698
erimatnor added a commit to erimatnor/timescaledb that referenced this issue Oct 15, 2021
This change removes a check for `USAGE` privileges on data nodes
required to query the data node using utility commands, such as
`hypertable_size`. Normally, PostgreSQL doesn't require `USAGE` on a
foreign server to query its remote tables. Also, size utilities, like
`pg_table_size` can be used by anyone---even roles without any
privileges on a table. The behavior on distributed hypertables is now
consistent with PostgreSQL.

Fixes timescale#3698
erimatnor added a commit that referenced this issue Oct 15, 2021
This change removes a check for `USAGE` privileges on data nodes
required to query the data node using utility commands, such as
`hypertable_size`. Normally, PostgreSQL doesn't require `USAGE` on a
foreign server to query its remote tables. Also, size utilities, like
`pg_table_size` can be used by anyone---even roles without any
privileges on a table. The behavior on distributed hypertables is now
consistent with PostgreSQL.

Fixes #3698
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants