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

[Bug]: permission denied for schema _timescaledb_internal when manually creating index on a continuous aggregate #4735

Closed
feikesteenbergen opened this issue Sep 20, 2022 · 1 comment · Fixed by #4767
Labels

Comments

@feikesteenbergen
Copy link
Member

What type of bug is this?

Unexpected error

What subsystems and features are affected?

Continuous aggregate

What happened?

When creating a materialized view as a regular user, the following error is raised when adding an index to a materialized view:

ERROR:  42501: permission denied for schema _timescaledb_internal

TimescaleDB version affected

2.8.0

PostgreSQL version used

14.5

What operating system did you use?

Ubuntu 22.04

What installation method did you use?

Source

What platform did you run on?

On prem/Self-hosted

Relevant log output and stack trace

ERROR:  42501: permission denied for schema _timescaledb_internal
LOCATION:  aclcheck_error, aclchk.c:3447

How can we reproduce the bug?

-- as a regular user, not as a superuser:
CREATE TABLE public.test(inserted timestamptz not null);
SELECT public.create_hypertable('test', 'inserted');
CREATE MATERIALIZED VIEW public.test_cagg WITH (
  timescaledb.continuous,
  timescaledb.materialized_only=false
) AS
SELECT
    public.time_bucket(interval '1 day', inserted) AS bucket,
    count(*) AS n_inserted
FROM
    public.test
GROUP BY
    bucket
WITH NO DATA;

CREATE INDEX ON public.test_cagg(n_inserted);
@jnidzwetzki
Copy link
Contributor

Hello @feikesteenbergen,

Thank you very much for reporting the issue. I could reproduce the problem also with TimescaleDB 2.9.0-dev (b31a015) and PostgreSQL 14.

CREATE USER mytestuser;
GRANT ALL PRIVILEGES ON DATABASE test2 TO mytestuser;
\c test2 mytestuser

CREATE TABLE public.test(inserted timestamptz not null);
SELECT public.create_hypertable('test', 'inserted');
CREATE MATERIALIZED VIEW public.test_cagg WITH (
  timescaledb.continuous,
  timescaledb.materialized_only=false
) AS
SELECT
    public.time_bucket(interval '1 day', inserted) AS bucket,
    count(*) AS n_inserted
FROM
    public.test
GROUP BY
    bucket
WITH NO DATA;

CREATE INDEX ON public.test_cagg(n_inserted);

ERROR:  permission denied for schema _timescaledb_internal

RafiaSabih added a commit to RafiaSabih/timescaledb that referenced this issue Sep 28, 2022
The materialised hypertable resides in the _timescaledb.internal schema
which resulted in permission error at the time of manual index creation
by non super user. To solve this, it now switches to timescaledb user
before index creation of CAgg.

Fixes timescale#4735
RafiaSabih added a commit to RafiaSabih/timescaledb that referenced this issue Sep 28, 2022
The materialised hypertable resides in the _timescaledb.internal schema
which resulted in permission error at the time of manual index creation
by non super user. To solve this, it now switches to timescaledb user
before index creation of CAgg.

Fixes timescale#4735
RafiaSabih added a commit to RafiaSabih/timescaledb that referenced this issue Sep 29, 2022
The materialised hypertable resides in the _timescaledb.internal schema
which resulted in permission error at the time of manual index creation
by non super user. To solve this, it now switches to timescaledb user
before index creation of CAgg.

Fixes timescale#4735
RafiaSabih added a commit to RafiaSabih/timescaledb that referenced this issue Sep 29, 2022
The materialised hypertable resides in the _timescaledb.internal schema
which resulted in permission error at the time of manual index creation
by non super user. To solve this, it now switches to timescaledb user
before index creation of CAgg.

Fixes timescale#4735
RafiaSabih added a commit to RafiaSabih/timescaledb that referenced this issue Sep 29, 2022
The materialised hypertable resides in the _timescaledb.internal schema
which resulted in permission error at the time of manual index creation
by non super user. To solve this, it now switches to timescaledb user
before index creation of CAgg.

Fixes timescale#4735
RafiaSabih added a commit to RafiaSabih/timescaledb that referenced this issue Sep 30, 2022
The materialised hypertable resides in the _timescaledb.internal schema
which resulted in permission error at the time of manual index creation
by non super user. To solve this, it now switches to timescaledb user
before index creation of CAgg.

Fixes timescale#4735
RafiaSabih added a commit to RafiaSabih/timescaledb that referenced this issue Sep 30, 2022
The materialised hypertable resides in the _timescaledb.internal schema
which resulted in permission error at the time of manual index creation
by non super user. To solve this, it now switches to timescaledb user
before index creation of CAgg.

Fixes timescale#4735
RafiaSabih added a commit to RafiaSabih/timescaledb that referenced this issue Sep 30, 2022
The materialised hypertable resides in the _timescaledb.internal schema
which resulted in permission error at the time of manual index creation
by non super user. To solve this, it now switches to timescaledb user
before index creation of CAgg.

Fixes timescale#4735
RafiaSabih added a commit to RafiaSabih/timescaledb that referenced this issue Sep 30, 2022
The materialised hypertable resides in the _timescaledb.internal schema
which resulted in permission error at the time of manual index creation
by non super user. To solve this, it now switches to timescaledb user
before index creation of CAgg.

Fixes timescale#4735
RafiaSabih added a commit to RafiaSabih/timescaledb that referenced this issue Sep 30, 2022
The materialised hypertable resides in the _timescaledb.internal schema
which resulted in permission error at the time of manual index creation
by non super user. To solve this, it now switches to timescaledb user
before index creation of CAgg.

Fixes timescale#4735
RafiaSabih added a commit to RafiaSabih/timescaledb that referenced this issue Sep 30, 2022
The materialised hypertable resides in the _timescaledb.internal schema
which resulted in permission error at the time of manual index creation
by non super user. To solve this, it now switches to timescaledb user
before index creation of CAgg.

Fixes timescale#4735
RafiaSabih added a commit to RafiaSabih/timescaledb that referenced this issue Sep 30, 2022
The materialised hypertable resides in the _timescaledb.internal schema
which resulted in permission error at the time of manual index creation
by non super user. To solve this, it now switches to timescaledb user
before index creation of CAgg.

Fixes timescale#4735
RafiaSabih added a commit to RafiaSabih/timescaledb that referenced this issue Sep 30, 2022
The materialised hypertable resides in the _timescaledb.internal schema
which resulted in permission error at the time of manual index creation
by non super user. To solve this, it now switches to timescaledb user
before index creation of CAgg.

Fixes timescale#4735
RafiaSabih added a commit that referenced this issue Sep 30, 2022
The materialised hypertable resides in the _timescaledb.internal schema
which resulted in permission error at the time of manual index creation
by non super user. To solve this, it now switches to timescaledb user
before index creation of CAgg.

Fixes #4735
jnidzwetzki pushed a commit to jnidzwetzki/timescaledb that referenced this issue Sep 30, 2022
The materialised hypertable resides in the _timescaledb.internal schema
which resulted in permission error at the time of manual index creation
by non super user. To solve this, it now switches to timescaledb user
before index creation of CAgg.

Fixes timescale#4735
jnidzwetzki pushed a commit to jnidzwetzki/timescaledb that referenced this issue Sep 30, 2022
The materialised hypertable resides in the _timescaledb.internal schema
which resulted in permission error at the time of manual index creation
by non super user. To solve this, it now switches to timescaledb user
before index creation of CAgg.

Fixes timescale#4735
jnidzwetzki pushed a commit to jnidzwetzki/timescaledb that referenced this issue Sep 30, 2022
The materialised hypertable resides in the _timescaledb.internal schema
which resulted in permission error at the time of manual index creation
by non super user. To solve this, it now switches to timescaledb user
before index creation of CAgg.

Fixes timescale#4735
jnidzwetzki pushed a commit to jnidzwetzki/timescaledb that referenced this issue Oct 4, 2022
The materialised hypertable resides in the _timescaledb.internal schema
which resulted in permission error at the time of manual index creation
by non super user. To solve this, it now switches to timescaledb user
before index creation of CAgg.

Fixes timescale#4735
jnidzwetzki pushed a commit that referenced this issue Oct 6, 2022
The materialised hypertable resides in the _timescaledb.internal schema
which resulted in permission error at the time of manual index creation
by non super user. To solve this, it now switches to timescaledb user
before index creation of CAgg.

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

Successfully merging a pull request may close this issue.

2 participants