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
Implement INFORMATION_SCHEMA.USER_DEFINED_TYPES and INFORMATION_SCHEMA.ATTRIBUTES #109603
Comments
Hello, I am Blathers. I am here to help you get the issue triaged. I have CC'd a few people who may be able to assist you:
If we have not gotten back to your issue within a few business days, you can try the following:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
I don't recall what I may have done differently yesterday, but this query no longer seems to produce results:
In fact: create type u as (i int, j int);
select * from pg_attribute as a where attname in ('i', 'j'); Doesn't yield results on version 23.1.8. That means I won't be able to reverse engineer UDTs in any way, I think? |
I've created another issue for the |
We should be able to add these as views that match the PG definitions: https://github.com/postgres/postgres/blob/9b581c53418666205938311ef86047aa3c6b741f/src/backend/catalog/information_schema.sql#L2461 Similar to what we did for information_schema.routines: #105944
|
This commit adds an implementation for the `information_schema._pg_char_octet_length` builtin. The builtin is implemented as a user-defined function in Postgres [here](https://github.com/postgres/postgres/blob/master/src/backend/catalog/information_schema.sql) Needed for: cockroachdb#109603 Epic: none Release note (sql change): The `information_schema._pg_char_octet_length` builtin function is now supported, which improves compatibility with PostgreSQL.
This commit adds an implementation for the `information_schema._pg_datetime_precision` builtin. The builtin is implemented as a user-defined function in Postgres [here](https://github.com/postgres/postgres/blob/master/src/backend/catalog/information_schema.sql) Needed for: cockroachdb#109603 Epic: none Release note (sql change): The `information_schema._pg_datetime_precision` builtin function is now supported, which improves compatibility with PostgreSQL.
This commit adds an implementation for the `information_schema._pg_interval_type` builtin. The builtin is implemented as a user-defined function in Postgres [here](https://github.com/postgres/postgres/blob/master/src/backend/catalog/information_schema.sql) Needed for: cockroachdb#109603 Epic: none Release note (sql change): The `information_schema._pg_interval_type` builtin function is now supported, which improves compatibility with PostgreSQL.
This commit adds an implementation for the `pg_encoding_max_length` builtin. Needed for: cockroachdb#109603 Epic: none Release note (sql change): The `pg_encoding_max_length` builtin function is now supported, which improves compatibility with PostgreSQL.
This patch populates information_schema.user_defined_types with information about user defined types and information_schema.attributes with information about the attributes of composite data types. Epic: none Fixes: cockroachdb#109603 Release note (sql change): This patch populates information_schema.user_defined_types with information about user defined types and information_schema.attributes with information about the attributes of composite data types.
This commit adds an implementation for the `information_schema._pg_char_octet_length` builtin. The builtin is implemented as a user-defined function in Postgres [here](https://github.com/postgres/postgres/blob/master/src/backend/catalog/information_schema.sql) Needed for: cockroachdb#109603 Epic: none Release note (sql change): The `information_schema._pg_char_octet_length` builtin function is now supported, which improves compatibility with PostgreSQL.
This commit adds an implementation for the `pg_encoding_max_length` builtin. Needed for: cockroachdb#109603 Epic: none Release note (sql change): The `pg_encoding_max_length` builtin function is now supported, which improves compatibility with PostgreSQL.
This commit adds an implementation for the `information_schema._pg_datetime_precision` builtin. The builtin is implemented as a user-defined function in Postgres [here](https://github.com/postgres/postgres/blob/master/src/backend/catalog/information_schema.sql) Needed for: cockroachdb#109603 Epic: none Release note (sql change): The `information_schema._pg_datetime_precision` builtin function is now supported, which improves compatibility with PostgreSQL.
This commit adds an implementation for the `information_schema._pg_interval_type` builtin. The builtin is implemented as a user-defined function in Postgres [here](https://github.com/postgres/postgres/blob/master/src/backend/catalog/information_schema.sql) Needed for: cockroachdb#109603 Epic: none Release note (sql change): The `information_schema._pg_interval_type` builtin function is now supported, which improves compatibility with PostgreSQL.
This patch populates information_schema.user_defined_types with information about user defined types and information_schema.attributes with information about the attributes of composite data types. Epic: none Fixes: cockroachdb#109603 Release note (sql change): This patch populates information_schema.user_defined_types with information about user defined types and information_schema.attributes with information about the attributes of composite data types.
This commit adds an implementation for the `information_schema._pg_char_octet_length` builtin. The builtin is implemented as a user-defined function in Postgres [here](https://github.com/postgres/postgres/blob/master/src/backend/catalog/information_schema.sql) Needed for: cockroachdb#109603 Epic: none Release note (sql change): The `information_schema._pg_char_octet_length` builtin function is now supported, which improves compatibility with PostgreSQL.
This commit adds an implementation for the `pg_encoding_max_length` builtin. Needed for: cockroachdb#109603 Epic: none Release note (sql change): The `pg_encoding_max_length` builtin function is now supported, which improves compatibility with PostgreSQL.
This commit adds an implementation for the `information_schema._pg_datetime_precision` builtin. The builtin is implemented as a user-defined function in Postgres [here](https://github.com/postgres/postgres/blob/master/src/backend/catalog/information_schema.sql) Needed for: cockroachdb#109603 Epic: none Release note (sql change): The `information_schema._pg_datetime_precision` builtin function is now supported, which improves compatibility with PostgreSQL.
This commit adds an implementation for the `information_schema._pg_interval_type` builtin. The builtin is implemented as a user-defined function in Postgres [here](https://github.com/postgres/postgres/blob/master/src/backend/catalog/information_schema.sql) Needed for: cockroachdb#109603 Epic: none Release note (sql change): The `information_schema._pg_interval_type` builtin function is now supported, which improves compatibility with PostgreSQL.
This patch populates information_schema.user_defined_types with information about user defined types and information_schema.attributes with information about the attributes of composite data types. Epic: none Fixes: cockroachdb#109603 Release note (sql change): This patch populates information_schema.user_defined_types with information about user defined types and information_schema.attributes with information about the attributes of composite data types.
111401: sql: populate information_schema.user_defined_types and attributes r=annrpom a=annrpom commit 1-4: ### sql: add necessary builtins for information_schema.user_defined_types These patches add the following builtins: - information_schema._pg_char_octet_length: returns the octet length of a given char/varchar/string - pg_encoding_max_length: returns the maximum length of a given encoding. Since we only support UTF8, this will return length 4. - information_schema._pg_datetime_precision: returns the precision of the given datetime-related type - information_schema._pg_interval_type: displays the interval type duration if it is set Needed for: #109603 Epic: none Release note (sql change): The information_schema._pg_char_octet_length, information_schema._pg_datetime_precision, information_schema._pg_interval_type, and pg_encoding_max_length builtin functions are now supported, which improves compatibility with PostgreSQL. --- last commit: ### sql: populate information_schema.user_defined_types and attributes This patch populates information_schema.user_defined_types with information about user defined types and information_schema.attributes with information about the attributes of composite data types. Epic: none Fixes: #109603 Release note (sql change): This patch populates information_schema.user_defined_types with information about user defined types and information_schema.attributes with information about the attributes of composite data types. 113498: obsservice: export StatementInsightsStatistics r=maryliag a=maryliag _commit 1:_ **obsservice: add stmt insights proto and conversion** Add proto definition for Statement Insights to be used on Obs Service. Creates function to copy a `insights.Insight` to the new `obspb.StatementInsightsStatistics` format. For this version, there are some parameters not being set, such as contention. Those will be populated on a following iteration. Epic: none Release note: None ---- _commit 2:_ **obsservice: export StatementInsightsStatistics** This patch hooks into the Flush functionality used by PersistedSQLStats, in preparation for Insights to be sent to external o11y systems. A following PR will do the actual export during the flush. Lastly, it's acknowledged that the transformation required here is likely going to be heavy on allocations. During the prototyping phase however, we leave the optimization and/or restructuring of the exported type for the future. For now, we use a sync.Pool in an effort to reduce allocations/GC. Release note: none 113626: debug: fix help text for `--include-range-info` debug zip flag r=dhartunian a=abarganier Fixes: #112053 This patch fixes the help text for the `--include-range-info` command available in `cockroach debug zip`. This is necessary, because `debug zip` now only creates a single file per node. The help text was not updated to reflect this. Release note: none 113835: team: embed TEAMS.yaml r=RaduBerinde a=RaduBerinde The `internal/team` code looks for `TEAMS.yaml` in the repo. This means that `roachtest` must be run in the tree (and if the branches don't match, obscure errors could happen in principle). This commit moves to embedding the data using `go:embed`. Because `go:embed` doesn't allow embedding of files outside the package, we also have to add a generation rule to copy the file. Fixes: #111661 Release note: None Co-authored-by: Annie Pompa <annie@cockroachlabs.com> Co-authored-by: maryliag <marylia@cockroachlabs.com> Co-authored-by: Alex Barganier <abarganier@cockroachlabs.com> Co-authored-by: Radu Berinde <radu@cockroachlabs.com>
Is your feature request related to a problem? Please describe.
I would like to reverse engineer user-defined types from the
INFORMATION_SCHEMA
via the standard views:USER_DEFINED_TYPES
ATTRIBUTES
Describe alternatives you've considered
I can probably work with queries against
pg_type
andpg_attribute
as I've done before with the lack ofROUTINES
support (see #104083):But for the future support of third party tooling, I still think these
INFORMATION_SCHEMA
views would be useful.Jira issue: CRDB-31015
The text was updated successfully, but these errors were encountered: