H2数据库2.x中的cross_reference的替换?
使用H2数据库的2.x版本Invoryation_schema
已大规模重建:
版本1.4.200和版本2.0.202之间有很大的变化,因此无法进行简单的更新。
不幸的是,表cross_references
现在似乎已经消失了。
在1.x版本中,我可以从中读取表的关系。有pktable_name
,pkcolumn_name
,fktable_name
,fkcolumn_name_name
,fk_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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Information_Schema.table_constraints
包含有关表中定义的所有约束的信息。如果Condect_Type
列包含值主键
或unique
,则可以通过参考约束来引用此约束。引用(外键)约束具有类型参考
。Information_Schema.Referential_constraints < / code>包含参考约束与它们所引用的唯一 /主密钥约束之间的链接。
Information_Schema.key_column_usage
包含有关主键,唯一和参照约束的列的信息。请注意,多列参考约束可能会以任何顺序引用相同列的唯一或主密钥约束,因此,对于多列参考约束,您需要检查ordinal_position
和position_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. IfCONSTRAINT_TYPE
column contains valuePRIMARY KEY
orUNIQUE
, this constraint can be referenced by a referential constraint. Referential (foreign key) constraints have typeREFERENTIAL
.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 bothORDINAL_POSITION
andPOSITION_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
.