PGAdmin3 隐藏对象类型
PGAdmin3 hidden object types
我已经在网络和 PGSQL 文档中搜索了关于什么对我来说是隐藏数据类型的信息,但没有找到任何信息。我正在处理一个现有数据库,该数据库具有 return 类型的函数,前面带有双下划线 (__some_type)。在 PGAdmin3 中,您可以选择在树视图中显示类型,在那里我看到了一些可识别的类型,这些类型在各种功能中使用,而没有,但我在任何地方都看不到这些其他类型。我了解到,通过 PyCharm 完整版,我可以连接到 PostgreSQL 数据库并查看我提到的所有类型。以及在带有“\dT”的控制台中,但不是在 PGAdmin 本身中。
Question: What is the deal with types that are preceded with one or two underscores? (__some_type).
跟进:我确实发现了一个未经验证的来源描述了一个限制用户创建以下划线开头的类型的约定,但尚未从 PG 来源证实这一点。
这是link:https://momjian.us/main/writings/pgsql/aw_pgsql_book/node223.html
而我提到的那条线一直到 "NOTES" 下方的底部:
Type names cannot begin with the underscore character ("_") and can
only be 31 characters long. This is because Postgres silently creates
an array type for each base type with a name consisting of the base
type's name prepended with an underscore.
继续搜索结果:
我找到了我所说内容的参考资料,但它没有详细说明此类类型的行为,或者如果用户违反此 'restriction'.
会发生什么
来自 6.3 文档的 PG 源代码:
As discussed earlier, Postgres fully supports arrays of base types.
Additionally, Postgres supports arrays of user-defined types as well.
When you define a type, Postgres automatically provides support for
arrays of that type. For historical reasons, the array type has the
same name as the user-defined type with the underscore character _
prepended. Composite types do not need any function defined on them,
since the system already understands what they look like inside.
Restrictions
Type names cannot begin with the underscore character ("_") and can
only be 15 characters long. This is because Postgres silently creates
an array type for each base type with a name consisting of the base
type's name prepended with an underscore.
我已经在网络和 PGSQL 文档中搜索了关于什么对我来说是隐藏数据类型的信息,但没有找到任何信息。我正在处理一个现有数据库,该数据库具有 return 类型的函数,前面带有双下划线 (__some_type)。在 PGAdmin3 中,您可以选择在树视图中显示类型,在那里我看到了一些可识别的类型,这些类型在各种功能中使用,而没有,但我在任何地方都看不到这些其他类型。我了解到,通过 PyCharm 完整版,我可以连接到 PostgreSQL 数据库并查看我提到的所有类型。以及在带有“\dT”的控制台中,但不是在 PGAdmin 本身中。
Question: What is the deal with types that are preceded with one or two underscores? (__some_type).
跟进:我确实发现了一个未经验证的来源描述了一个限制用户创建以下划线开头的类型的约定,但尚未从 PG 来源证实这一点。
这是link:https://momjian.us/main/writings/pgsql/aw_pgsql_book/node223.html
而我提到的那条线一直到 "NOTES" 下方的底部:
Type names cannot begin with the underscore character ("_") and can only be 31 characters long. This is because Postgres silently creates an array type for each base type with a name consisting of the base type's name prepended with an underscore.
继续搜索结果: 我找到了我所说内容的参考资料,但它没有详细说明此类类型的行为,或者如果用户违反此 'restriction'.
会发生什么来自 6.3 文档的 PG 源代码:
As discussed earlier, Postgres fully supports arrays of base types. Additionally, Postgres supports arrays of user-defined types as well. When you define a type, Postgres automatically provides support for arrays of that type. For historical reasons, the array type has the same name as the user-defined type with the underscore character _ prepended. Composite types do not need any function defined on them, since the system already understands what they look like inside.
Restrictions
Type names cannot begin with the underscore character ("_") and can only be 15 characters long. This is because Postgres silently creates an array type for each base type with a name consisting of the base type's name prepended with an underscore.