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

table-privileges not rendered correctly when granting "ALL" #8332

Open
aremund opened this issue Jan 6, 2025 · 5 comments
Open

table-privileges not rendered correctly when granting "ALL" #8332

aremund opened this issue Jan 6, 2025 · 5 comments
Assignees
Milestone

Comments

@aremund
Copy link

aremund commented Jan 6, 2025

When granting Users or Roles with "ALL" on a table, this is not correctly rendered in the "Security"-section of the tables "Properties"-pop-up.

To Reproduce
Create a new table and grant a user "ALL" on it.

CREATE TABLE IF NOT EXISTS sys.test
(
    id bigint NOT NULL,
    CONSTRAINT test_pkey PRIMARY KEY (id)
)

TABLESPACE pg_default;

ALTER TABLE IF EXISTS sys.test
    OWNER to dbadmin;

GRANT ALL ON TABLE sys.test TO dbadmin WITH GRANT OPTION;

Expected behavior
When opening the "Properties"-pop-up of this table, the "Privileges" should be rendered correctly.

Error message
Instead, UNKNOWN is part of the rendered "Privileges"

Screenshots
properties

Desktop

  • OS: Debian
  • Version: 8.14
  • Mode: Server
  • Browser: Chrome
  • Package type: Container
@akshay-joshi
Copy link
Contributor

@aremund

I cannot reproduce the issue on the latest release or source code.

Screenshot 2025-01-08 at 1 05 39 PM

Can you please provide the exact reproduction steps? Please provide the following information:

  1. Version of the database server.
  2. DDL of the role 'dbadmin'.

@aremund
Copy link
Author

aremund commented Jan 8, 2025

@akshay-joshi

I just tried it again with the SNAPSHOT-Container and can still reproduce the problem. We only have the problem since we upgraded Postgres to 17.2.

CREATE ROLE testuser WITH
  NOLOGIN
  NOSUPERUSER
  INHERIT
  NOCREATEDB
  NOCREATEROLE
  NOREPLICATION
  NOBYPASSRLS;

CREATE TABLE IF NOT EXISTS sys.test
(
    id bigint NOT NULL,
    CONSTRAINT test_pkey PRIMARY KEY (id)
)
TABLESPACE pg_default;

ALTER TABLE IF EXISTS sys.test
    OWNER to testuser;

GRANT ALL ON TABLE sys.test TO testuser WITH GRANT OPTION;

image

We are having the following Postgres-Version:

select version();
--> PostgreSQL 17.2 (Debian 17.2-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit

@akshay-joshi
Copy link
Contributor

OK Let me test on PostgreSQL 17.2

@adityatoshniwal
Copy link
Contributor

I think it is because of new MAINTAIN privilege added by PG-17 https://www.postgresql.org/docs/current/ddl-priv.html#DDL-PRIV-MAINTAIN

@akshay-joshi akshay-joshi assigned akshay-joshi and unassigned aremund Jan 8, 2025
@akshay-joshi akshay-joshi moved this to 🏗 In Progress in Current Sprint (184) Jan 8, 2025
@akshay-joshi akshay-joshi added this to the 9.0 milestone Jan 8, 2025
@akshay-joshi
Copy link
Contributor

akshay-joshi commented Jan 9, 2025

Impacted nodes:

  1. Table, Partition, View, MView, Foreign Table,
  2. Database -> Default Privilege -> Table

MAINTAIN Privilege is added in PG >= 17, so it should not be visible for version < 17.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🏗 In Progress
Development

No branches or pull requests

3 participants