所有 RDBMS 都具有可与 Oracle 相媲美的数据字典吗?

发布于 2024-09-14 21:50:45 字数 202 浏览 2 评论 0原文

是否可以

  • 来检索以下信息:表、
  • 索引及其列、它们
  • 对每个表中的列进行索引以及它们的类型
  • 约束(例如唯一键、外键、非空 ..)

使用所有(主要)RDBMS 中的 sql

?我知道这对甲骨文来说是可能的,并且假设对大多数其他人来说也是可能的。这有什么重要的例外吗?

Is it possible to retrieve information like:

  • the tables
  • the indexes with the columns they index
  • the columns in each table along with their types
  • constraints like unique keys, foreign keys, not null ..

using sql from all (major) RDBMSs?

I know it is possible for oracle and assume it is possible for most others. Are there any important exceptions to this?

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

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

发布评论

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

评论(3

寄意 2024-09-21 21:50:45

对于许多数据库,您可以使用 INFORMATION_SCHEMA 表:

SELECT *
FROM INFORMATION_SCHEMA.Columns

以及类似的选择来获取其他信息,例如索引和关系。

根据 此链接

  • Microsoft SQL Server - 在版本 7 及更高版本中受支持
  • MySQL - 支持在版本 5 及更高版本中
  • PostgreSQL - 在版本 7.4 及更高版本中受支持
  • Oracle - 似乎不受支持
  • Apache Derby - 从版本 10.3 起不受支持

For many databases you can make use of the INFORMATION_SCHEMA tables:

SELECT *
FROM INFORMATION_SCHEMA.Columns

and similar selects for other info such as indexes and relationships.

According to this link:

  • Microsoft SQL Server - Supported in Version 7 and up
  • MySQL - Supported in Version 5 and up
  • PostgreSQL - Supported in Version 7.4 and up
  • Oracle - Does not appear to be supported
  • Apache Derby - NOT Supported As of Version 10.3
ぺ禁宫浮华殁 2024-09-21 21:50:45

这可能是可能的,但是如何执行此操作的细节会因 RDBMS 的不同而有所不同。您最好的选择可能是阅读您正在使用的系统的手册。

It is probably possible but the details of how to do it will vary from one RDBMS to another. Your best bet is probably to read the manual for the system you're working with.

灵芸 2024-09-21 21:50:45

当 Codd 制定了他著名的 12 条规则时,这些规则旨在作为“衡量某些给定 DBMS 系统的关系性”的尺度,其中一条规则是(类似的)“元数据信息应该可供用户精确地使用与用于查询数据本身的设施相同的设施”。

现在已经是大约 30 年前的事了,所以很难想象,如果一个系统不符合这个“规定”,那么今天它实际上敢于称自己为“关系型”系统,尤其是因为它是一个根本不难实现的系统。见面。

When Codd formulated his famous 12 rules, which were intended as a yardstick to 'measure the relationality' of some given DBMS system, one of those rules was (something of the ilk) that "metadata information should be queryable for the user using exactly the same facilities as those that are used for querying the data itself".

That is now around some 30 years ago, so it is hard to imagine that a system would actually dare call itself 'relational' today if it doesn't meet that "prescription", especially as it is one that is not difficult at all to meet.

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