Skip to content

cli: cockroach dump only available to root user #7964

@jseldess

Description

@jseldess

When connecting with any user but root, you always get this message:

Error: pq: user jeldess does not have SELECT privilege on table descriptor
Failed running "dump"

Only the root user has privileges for the system.descriptor table, so only the root user can run cockroach dump. Instead, I would expect any user to be able to dump a table, as long as that user has SELECT privileges on the database and table.

Example:

# Connect as user jseldess:
$ cockroach dump test dumptest --user=jeldess
Error: pq: user jeldess does not have SELECT privilege on table descriptor
Failed running "dump"

# Connect as user root (default):
$ cockroach dump test dumptest
CREATE TABLE dumptest (
    a INT NOT NULL,
    b DECIMAL(10) NULL,
    CONSTRAINT "primary" PRIMARY KEY (a),
    FAMILY "primary" (a, b)
);

INSERT INTO dumptest VALUES
    (1, 1.1),
    (2, 2.2),
    (3, 3.3);

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions