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

sql: support has_{schema,database,table}_privilege #20784

Closed
jordanlewis opened this issue Dec 17, 2017 · 0 comments
Closed

sql: support has_{schema,database,table}_privilege #20784

jordanlewis opened this issue Dec 17, 2017 · 0 comments
Labels
A-sql-pgcompat Semantic compatibility with PostgreSQL

Comments

@jordanlewis
Copy link
Member

https://www.postgresql.org/docs/10/static/functions-info.html

These are needed for pgadmin.

@jordanlewis jordanlewis added the A-sql-pgcompat Semantic compatibility with PostgreSQL label Dec 17, 2017
nvanbenschoten added a commit to nvanbenschoten/cockroach that referenced this issue Mar 3, 2018
Fixes cockroachdb#22734.
Fixes cockroachdb#20784.
Relates to cockroachdb#15441.

This change introduces a series of Postgres-compatible privilege-related
builtin functions:
- `has_any_column_privilege`
- `has_column_privilege`
- `has_database_privilege`
- `has_foreign_data_wrapper_privilege`
- `has_function_privilege`
- `has_language_privilege`
- `has_schema_privilege`
- `has_sequence_privilege`
- `has_server_privilege`
- `has_table_privilege`
- `has_tablespace_privilege`
- `has_type_privilege`
- `pg_has_role` (_coming soon!_)

These all follow the specification documented by Postgres in:
https://www.postgresql.org/docs/8.4/static/functions-info.html#FUNCTIONS-INFO-ACCESS-TABLE

These Access Privilege Inquiry Functions allow users to query object
access privileges programmatically. Each function has a number of
variants, which differ based on their function signatures. These
signatures have the following structure:
```
- optional "user" argument
  - if used, can be a STRING or an OID type
  - if not used, current_user is assumed
- series of one or more object specifier arguments
  - each can accept multiple types
- a "privilege" argument
  - must be a STRING
  - parsed as a comma-separated list of privilege
```

This means that in total, each function has at least 6 variants.

The main reason for adding these builtins in is because they were the
last remaining issue that was blocking full compatibility with pgweb.
Pgweb is a web-based database browser written in Go, which means that
can run on OSX, Linux and Windows machines!

Release note (sql change): Introduces a series of Postgres-compatible
privilege-related builtin functions.
nvanbenschoten added a commit to nvanbenschoten/cockroach that referenced this issue Mar 14, 2018
Fixes cockroachdb#22734.
Fixes cockroachdb#20784.
Relates to cockroachdb#15441.

This change introduces a series of Postgres-compatible privilege-related
builtin functions:
- `has_any_column_privilege`
- `has_column_privilege`
- `has_database_privilege`
- `has_foreign_data_wrapper_privilege`
- `has_function_privilege`
- `has_language_privilege`
- `has_schema_privilege`
- `has_sequence_privilege`
- `has_server_privilege`
- `has_table_privilege`
- `has_tablespace_privilege`
- `has_type_privilege`
- `pg_has_role` (_coming soon!_)

These all follow the specification documented by Postgres in:
https://www.postgresql.org/docs/8.4/static/functions-info.html#FUNCTIONS-INFO-ACCESS-TABLE

These Access Privilege Inquiry Functions allow users to query object
access privileges programmatically. Each function has a number of
variants, which differ based on their function signatures. These
signatures have the following structure:
```
- optional "user" argument
  - if used, can be a STRING or an OID type
  - if not used, current_user is assumed
- series of one or more object specifier arguments
  - each can accept multiple types
- a "privilege" argument
  - must be a STRING
  - parsed as a comma-separated list of privilege
```

This means that in total, each function has at least 6 variants.

The main reason for adding these builtins in is because they were the
last remaining issue that was blocking full compatibility with pgweb.
Pgweb is a web-based database browser written in Go, which means that
can run on OSX, Linux and Windows machines!

Release note (sql change): Introduces a series of Postgres-compatible
privilege-related builtin functions.
nvanbenschoten added a commit to nvanbenschoten/cockroach that referenced this issue Mar 14, 2018
Fixes cockroachdb#22734.
Fixes cockroachdb#20784.
Relates to cockroachdb#15441.

This change introduces a series of Postgres-compatible privilege-related
builtin functions:
- `has_any_column_privilege`
- `has_column_privilege`
- `has_database_privilege`
- `has_foreign_data_wrapper_privilege`
- `has_function_privilege`
- `has_language_privilege`
- `has_schema_privilege`
- `has_sequence_privilege`
- `has_server_privilege`
- `has_table_privilege`
- `has_tablespace_privilege`
- `has_type_privilege`
- `pg_has_role` (_coming soon!_)

These all follow the specification documented by Postgres in:
https://www.postgresql.org/docs/8.4/static/functions-info.html#FUNCTIONS-INFO-ACCESS-TABLE

These Access Privilege Inquiry Functions allow users to query object
access privileges programmatically. Each function has a number of
variants, which differ based on their function signatures. These
signatures have the following structure:
```
- optional "user" argument
  - if used, can be a STRING or an OID type
  - if not used, current_user is assumed
- series of one or more object specifier arguments
  - each can accept multiple types
- a "privilege" argument
  - must be a STRING
  - parsed as a comma-separated list of privilege
```

This means that in total, each function has at least 6 variants.

The main reason for adding these builtins in is because they were the
last remaining issue that was blocking full compatibility with pgweb.
Pgweb is a web-based database browser written in Go, which means that
can run on OSX, Linux and Windows machines!

Release note (sql change): Introduces a series of Postgres-compatible
privilege-related builtin functions.
nvanbenschoten added a commit to nvanbenschoten/cockroach that referenced this issue Mar 14, 2018
Fixes cockroachdb#22734.
Fixes cockroachdb#20784.
Relates to cockroachdb#15441.

This change introduces a series of Postgres-compatible privilege-related
builtin functions:
- `has_any_column_privilege`
- `has_column_privilege`
- `has_database_privilege`
- `has_foreign_data_wrapper_privilege`
- `has_function_privilege`
- `has_language_privilege`
- `has_schema_privilege`
- `has_sequence_privilege`
- `has_server_privilege`
- `has_table_privilege`
- `has_tablespace_privilege`
- `has_type_privilege`
- `pg_has_role` (_coming soon!_)

These all follow the specification documented by Postgres in:
https://www.postgresql.org/docs/8.4/static/functions-info.html#FUNCTIONS-INFO-ACCESS-TABLE

These Access Privilege Inquiry Functions allow users to query object
access privileges programmatically. Each function has a number of
variants, which differ based on their function signatures. These
signatures have the following structure:
```
- optional "user" argument
  - if used, can be a STRING or an OID type
  - if not used, current_user is assumed
- series of one or more object specifier arguments
  - each can accept multiple types
- a "privilege" argument
  - must be a STRING
  - parsed as a comma-separated list of privilege
```

This means that in total, each function has at least 6 variants.

The main reason for adding these builtins in is because they were the
last remaining issue that was blocking full compatibility with pgweb.
Pgweb is a web-based database browser written in Go, which means that
can run on OSX, Linux and Windows machines!

Release note (sql change): Introduces a series of Postgres-compatible
privilege-related builtin functions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sql-pgcompat Semantic compatibility with PostgreSQL
Projects
None yet
Development

No branches or pull requests

1 participant