H2数据库2.x中的cross_reference的替换?

发布于 2025-01-30 12:05:46 字数 473 浏览 2 评论 0原文

使用H2数据库的2.x版本Invoryation_schema已大规模重建:

版本1.4.200和版本2.0.202之间有很大的变化,因此无法进行简单的更新。

不幸的是,表cross_references现在似乎已经消失了。

在1.x版本中,我可以从中读取表的关系。有pktable_namepkcolumn_namefktable_namefkcolumn_name_namefk_name代码> pk_name 。

到目前为止,我尚未在inovery_schema 2.x中的任何表/视图中找到此信息。

有人知道我如何获取信息吗?

谢谢

With the 2.x version of the H2 database INFORMATION_SCHEMA has been massively rebuilt:

Between version 1.4.200 and version 2.0.202 there have been considerable changes, such that a simple update is not possible.

Unfortunately, the table CROSS_REFERENCES now seems to have disappeared.

In the 1.x version I could read the relationships of the tables from this. There were columns like PKTABLE_NAME, PKCOLUMN_NAME, FKTABLE_NAME, FKCOLUMN_NAME, FK_NAME and PK_NAME.

I have not found this information in any table/view in INFORMATION_SCHEMA 2.x so far.

Does anyone know how I can get the information which ?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

薆情海 2025-02-06 12:05:46

Information_Schema.table_constraints包含有关表中定义的所有约束的信息。如果Condect_Type列包含值主键unique,则可以通过参考约束来引用此约束。引用(外键)约束具有类型参考

Information_Schema.Referential_constraints < / code>包含参考约束与它们所引用的唯一 /主密钥约束之间的链接。

Information_Schema.key_column_usage包含有关主键,唯一和参照约束的列的信息。请注意,多列参考约束可能会以任何顺序引用相同列的唯一或主密钥约束,因此,对于多列参考约束,您需要检查ordinal_positionposition_in_in_unique_constraint_constraint_constraintaint正确确定链接的列。

所有这些表均在第11部分中标准化:SQL标准的信息和定义架构(SQL/Schemata),因此它们在具有标准Information_schema 。

INFORMATION_SCHEMA.TABLE_CONSTRAINTS contains information about all constraints defined in your tables. If CONSTRAINT_TYPE column contains value PRIMARY KEY or UNIQUE, this constraint can be referenced by a referential constraint. Referential (foreign key) constraints have type REFERENTIAL.

INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS contains links between referential constraints and unique / primary key constraints referenced by them.

INFORMATION_SCHEMA.KEY_COLUMN_USAGE contains information about columns of primary key, unique, and referential constraints. Please note that multi-column referential constraints may reference unique or primary key constraints with the same sets of columns in any order, so for multi-column referential constraint you need to check both ORDINAL_POSITION and POSITION_IN_UNIQUE_CONSTRAINT to determine linked columns properly.

All these tables are standardized in Part 11: Information and Definition Schemas (SQL/Schemata) of the SQL Standard, so they are more or less portable across all databases that have standard INFORMATION_SCHEMA.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文