-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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: Complete the information_schema by adding empty table definitions #8675
Comments
@nvanbenschoten I'm going to create the
|
That sounds reasonable @yananzhi, thanks! |
@nvanbenschoten I'm planning to create
It refers to the postgresql document: https://www.postgresql.org/docs/9.5/static/infoschema-views.html |
@mtMabo yep that looks good. Thanks! |
@nvanbenschoten I'm planning to create information_schema.user_privileges as follows :
It refers to the mysql document: https://dev.mysql.com/doc/refman/5.7/en/user-privileges-table.html |
@yangliang9004, LGTM |
@benesch https://github.com/radutopala/cockroach-app/issues .. found these so far, with PHP/Symfony/Doctrine. |
This is almost verbatim the example from https://github.com/diesel-rs/diesel/tree/3ae353c3aff8a7ea64ed6cb39b3a045ac86cd60e/examples/postgres with minor adjustments: 1. after `diesel setup`, edit the created `up.sql` and `down.sql` to contain only a trivial statement (like `SELECT 1`). This is necessary because by default they contain a [random trigger] that CockroachDB can't handle. 2. `schema.rs` was manually spelled out using the `table!` macro. The tutorial uses `infer_schema!` for which we don't have all the [internals]. Note that we use `BigInt` to properly support CockroachDB's `SERIAL` type. In turn, `struct Post` has `id: i64` instead of `i32`. 3. Some adjustments in `show_posts` to list the ID which is otherwise impossible to guess. 4. Pinned the diesel dependency for no good reason (to hopefully have this go stale later). There are likely more problems not discovered by this toy example. See the [tracking issue]. [random trigger]: https://github.com/diesel-rs/diesel/blob/master/diesel_cli/src/setup_sql/postgres/initial_setup/up.sql [internals]: cockroachdb/cockroach#8675 [tracking issue]: cockroachdb/cockroach#13787
@nvanbenschoten I wanted to pick up
But the column_descriptor in ColumnDescriptor doesnot have any PriviliegeDescriptor. Any pointers for me ? |
CockroachDB doesn't have separate column privileges like some other
databases do. Postgres before 8.4 had the same limitation, so I'd follow
their old behavior here:
In PostgreSQL, you can only grant privileges on entire tables, not
individual columns. Therefore, this view contains the same information as
table_privileges, just represented through one row for each column in each
appropriate table, but it only covers privilege types where column
granularity is possible: SELECT, INSERT, UPDATE, REFERENCES.
…On Fri, Dec 22, 2017 at 11:32 AM, Sumit ***@***.***> wrote:
@nvanbenschoten <https://github.com/nvanbenschoten> I wanted to pick up
column_privileges, like this
CREATE TABLE information_schema.column_privilege (
GRANTER STRING NOT NULL DEFAULT '',
GRANTEE STRING NOT NULL DEFAULT '',
TABLE_CATALOG STRING NOT NULL DEFAULT '',
TABLE_SCHEMA STRING NOT NULL DEFAULT '',
TABLE_NAME STRING NOT NULL DEFAULT '',
COLUMN_NAME STRING NOT NULL DEFAULT '',
PRIVILEGE_TYPE STRING NOT NULL DEFAULT '',
IS_GRANTABLE BOOL NOT NULL DEFAULT FALSE
);
But the column_descriptor in ColumnDescriptor
<https://github.com/cockroachdb/cockroach/blob/master/pkg/sql/sqlbase/structured.pb.go#L447>
doesnot have any PriviliegeDescriptor
<https://github.com/cockroachdb/cockroach/blob/master/pkg/sql/sqlbase/privilege.pb.go#L31>
.
Any pointers for me ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8675 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA15IM4i4ncCbv7Y2znmj1V0J3rmEY6pks5tC9mbgaJpZM4Jn6VP>
.
|
hi, i'd like to work on |
The `session_variables` table exposes the session variables. Related to: cockroachdb#8675 Release note (sql change): Added session_variables table to the information_schema.
The `session_variables` table exposes the session variables. Related to: cockroachdb#8675 Release note (sql change): Added session_variables table to the information_schema.
57837: sql: Add information_schema.session_variables table r=rafiss a=mneverov sql: Add information_schema.session_variables table The `session_variables` table exposes the session variables. Related to: #8675 Release note (sql change): Added session_variables table to the information_schema. Co-authored-by: Max Neverov <neverov.max@gmail.com>
Previously, there were 38 undefined information_schema tables that exists in postgres This was inadequate because not having them may cause compatibility issues To address this, this patch defines these 38 tables as unimplemented to allow queries Release note (sql change): adding empty missing tables on information schema for compatibility: attributes check_constraint_routine_usage column_column_usage column_domain_usage column_options constraint_table_usage data_type_privileges domain_constraints domain_udt_usage domains element_types foreign_data_wrapper_options foreign_data_wrappers foreign_server_options foreign_servers foreign_table_options foreign_tables information_schema_catalog_name role_column_grants role_routine_grants role_udt_grants role_usage_grants routine_privileges sql_features sql_implementation_info sql_parts sql_sizing transforms triggered_update_columns triggers udt_privileges usage_privileges user_defined_types user_mapping_options user_mappings view_column_usage view_routine_usage view_table_usage Related to: cockroachdb#8675
Previously, there were 38 undefined information_schema tables that exists in postgres This was inadequate because not having them may cause compatibility issues To address this, this patch defines these 38 tables as unimplemented to allow queries Release note (sql change): adding empty missing tables on information schema for compatibility: attributes check_constraint_routine_usage column_column_usage column_domain_usage column_options constraint_table_usage data_type_privileges domain_constraints domain_udt_usage domains element_types foreign_data_wrapper_options foreign_data_wrappers foreign_server_options foreign_servers foreign_table_options foreign_tables information_schema_catalog_name role_column_grants role_routine_grants role_udt_grants role_usage_grants routine_privileges sql_features sql_implementation_info sql_parts sql_sizing transforms triggered_update_columns triggers udt_privileges usage_privileges user_defined_types user_mapping_options user_mappings view_column_usage view_routine_usage view_table_usage Related to: cockroachdb#8675
65854: sql: adding missing tables on information_schema r=rafiss a=mnovelodou Previously, there were 38 undefined information_schema tables that exists in postgres This was inadequate because not having them may cause compatibility issues To address this, this patch defines these 38 tables as unimplemented to allow queries Release note (sql change): adding empty missing tables on information schema for compatibility: attributes check_constraint_routine_usage column_column_usage column_domain_usage column_options constraint_table_usage data_type_privileges domain_constraints domain_udt_usage domains element_types foreign_data_wrapper_options foreign_data_wrappers foreign_server_options foreign_servers foreign_table_options foreign_tables information_schema_catalog_name role_column_grants role_routine_grants role_udt_grants role_usage_grants routine_privileges sql_features sql_implementation_info sql_parts sql_sizing transforms triggered_update_columns triggers udt_privileges usage_privileges user_defined_types user_mapping_options user_mappings view_column_usage view_routine_usage view_table_usage Related to: #8675 66711: roachtest: bump predecessor to v21.1.3 r=celiala a=celiala Release note: None Co-authored-by: MiguelNovelo <miguel.novelo@digitalonus.com> Co-authored-by: Celia La <celiala456@gmail.com>
#8119 introduced the framework for creating virtual schemas, and specifically, the
information_schema
. Subsequently, a group PRs added what was deemed to be the most immediately critical set of tables. However, the specification for theinformation_schema
is extensive, and there are a number of other tables which can be added with relative ease. The set of allinformation_schema
tables is:The process for adding a new
information_schema
table is:virtualSchemaTable
variable with a table schema definitionHelpful sources:
The text was updated successfully, but these errors were encountered: