blob: cddc330557aebfc695ccd2d8ad0414dce11b6705 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 36. The Information Schema</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /><link rel="prev" href="ecpg-develop.html" title="35.16. Internals" /><link rel="next" href="infoschema-schema.html" title="36.1. The Schema" /></head><body id="docContent" class="container-fluid col-10"><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">Chapter 36. The Information Schema</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="ecpg-develop.html" title="35.16. Internals">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="client-interfaces.html" title="Part IV. Client Interfaces">Up</a></td><th width="60%" align="center">Part IV. Client Interfaces</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 13.4 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="infoschema-schema.html" title="36.1. The Schema">Next</a></td></tr></table><hr></hr></div><div class="chapter" id="INFORMATION-SCHEMA"><div class="titlepage"><div><div><h2 class="title">Chapter 36. The Information Schema</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="sect1"><a href="infoschema-schema.html">36.1. The Schema</a></span></dt><dt><span class="sect1"><a href="infoschema-datatypes.html">36.2. Data Types</a></span></dt><dt><span class="sect1"><a href="infoschema-information-schema-catalog-name.html">36.3. <code class="literal">information_schema_catalog_name</code></a></span></dt><dt><span class="sect1"><a href="infoschema-administrable-role-authorizations.html">36.4. <code class="literal">administrable_role_authorizations</code></a></span></dt><dt><span class="sect1"><a href="infoschema-applicable-roles.html">36.5. <code class="literal">applicable_roles</code></a></span></dt><dt><span class="sect1"><a href="infoschema-attributes.html">36.6. <code class="literal">attributes</code></a></span></dt><dt><span class="sect1"><a href="infoschema-character-sets.html">36.7. <code class="literal">character_sets</code></a></span></dt><dt><span class="sect1"><a href="infoschema-check-constraint-routine-usage.html">36.8. <code class="literal">check_constraint_routine_usage</code></a></span></dt><dt><span class="sect1"><a href="infoschema-check-constraints.html">36.9. <code class="literal">check_constraints</code></a></span></dt><dt><span class="sect1"><a href="infoschema-collations.html">36.10. <code class="literal">collations</code></a></span></dt><dt><span class="sect1"><a href="infoschema-collation-character-set-applicab.html">36.11. <code class="literal">collation_character_set_applicability</code></a></span></dt><dt><span class="sect1"><a href="infoschema-column-column-usage.html">36.12. <code class="literal">column_column_usage</code></a></span></dt><dt><span class="sect1"><a href="infoschema-column-domain-usage.html">36.13. <code class="literal">column_domain_usage</code></a></span></dt><dt><span class="sect1"><a href="infoschema-column-options.html">36.14. <code class="literal">column_options</code></a></span></dt><dt><span class="sect1"><a href="infoschema-column-privileges.html">36.15. <code class="literal">column_privileges</code></a></span></dt><dt><span class="sect1"><a href="infoschema-column-udt-usage.html">36.16. <code class="literal">column_udt_usage</code></a></span></dt><dt><span class="sect1"><a href="infoschema-columns.html">36.17. <code class="literal">columns</code></a></span></dt><dt><span class="sect1"><a href="infoschema-constraint-column-usage.html">36.18. <code class="literal">constraint_column_usage</code></a></span></dt><dt><span class="sect1"><a href="infoschema-constraint-table-usage.html">36.19. <code class="literal">constraint_table_usage</code></a></span></dt><dt><span class="sect1"><a href="infoschema-data-type-privileges.html">36.20. <code class="literal">data_type_privileges</code></a></span></dt><dt><span class="sect1"><a href="infoschema-domain-constraints.html">36.21. <code class="literal">domain_constraints</code></a></span></dt><dt><span class="sect1"><a href="infoschema-domain-udt-usage.html">36.22. <code class="literal">domain_udt_usage</code></a></span></dt><dt><span class="sect1"><a href="infoschema-domains.html">36.23. <code class="literal">domains</code></a></span></dt><dt><span class="sect1"><a href="infoschema-element-types.html">36.24. <code class="literal">element_types</code></a></span></dt><dt><span class="sect1"><a href="infoschema-enabled-roles.html">36.25. <code class="literal">enabled_roles</code></a></span></dt><dt><span class="sect1"><a href="infoschema-foreign-data-wrapper-options.html">36.26. <code class="literal">foreign_data_wrapper_options</code></a></span></dt><dt><span class="sect1"><a href="infoschema-foreign-data-wrappers.html">36.27. <code class="literal">foreign_data_wrappers</code></a></span></dt><dt><span class="sect1"><a href="infoschema-foreign-server-options.html">36.28. <code class="literal">foreign_server_options</code></a></span></dt><dt><span class="sect1"><a href="infoschema-foreign-servers.html">36.29. <code class="literal">foreign_servers</code></a></span></dt><dt><span class="sect1"><a href="infoschema-foreign-table-options.html">36.30. <code class="literal">foreign_table_options</code></a></span></dt><dt><span class="sect1"><a href="infoschema-foreign-tables.html">36.31. <code class="literal">foreign_tables</code></a></span></dt><dt><span class="sect1"><a href="infoschema-key-column-usage.html">36.32. <code class="literal">key_column_usage</code></a></span></dt><dt><span class="sect1"><a href="infoschema-parameters.html">36.33. <code class="literal">parameters</code></a></span></dt><dt><span class="sect1"><a href="infoschema-referential-constraints.html">36.34. <code class="literal">referential_constraints</code></a></span></dt><dt><span class="sect1"><a href="infoschema-role-column-grants.html">36.35. <code class="literal">role_column_grants</code></a></span></dt><dt><span class="sect1"><a href="infoschema-role-routine-grants.html">36.36. <code class="literal">role_routine_grants</code></a></span></dt><dt><span class="sect1"><a href="infoschema-role-table-grants.html">36.37. <code class="literal">role_table_grants</code></a></span></dt><dt><span class="sect1"><a href="infoschema-role-udt-grants.html">36.38. <code class="literal">role_udt_grants</code></a></span></dt><dt><span class="sect1"><a href="infoschema-role-usage-grants.html">36.39. <code class="literal">role_usage_grants</code></a></span></dt><dt><span class="sect1"><a href="infoschema-routine-privileges.html">36.40. <code class="literal">routine_privileges</code></a></span></dt><dt><span class="sect1"><a href="infoschema-routines.html">36.41. <code class="literal">routines</code></a></span></dt><dt><span class="sect1"><a href="infoschema-schemata.html">36.42. <code class="literal">schemata</code></a></span></dt><dt><span class="sect1"><a href="infoschema-sequences.html">36.43. <code class="literal">sequences</code></a></span></dt><dt><span class="sect1"><a href="infoschema-sql-features.html">36.44. <code class="literal">sql_features</code></a></span></dt><dt><span class="sect1"><a href="infoschema-sql-implementation-info.html">36.45. <code class="literal">sql_implementation_info</code></a></span></dt><dt><span class="sect1"><a href="infoschema-sql-parts.html">36.46. <code class="literal">sql_parts</code></a></span></dt><dt><span class="sect1"><a href="infoschema-sql-sizing.html">36.47. <code class="literal">sql_sizing</code></a></span></dt><dt><span class="sect1"><a href="infoschema-table-constraints.html">36.48. <code class="literal">table_constraints</code></a></span></dt><dt><span class="sect1"><a href="infoschema-table-privileges.html">36.49. <code class="literal">table_privileges</code></a></span></dt><dt><span class="sect1"><a href="infoschema-tables.html">36.50. <code class="literal">tables</code></a></span></dt><dt><span class="sect1"><a href="infoschema-transforms.html">36.51. <code class="literal">transforms</code></a></span></dt><dt><span class="sect1"><a href="infoschema-triggered-update-columns.html">36.52. <code class="literal">triggered_update_columns</code></a></span></dt><dt><span class="sect1"><a href="infoschema-triggers.html">36.53. <code class="literal">triggers</code></a></span></dt><dt><span class="sect1"><a href="infoschema-udt-privileges.html">36.54. <code class="literal">udt_privileges</code></a></span></dt><dt><span class="sect1"><a href="infoschema-usage-privileges.html">36.55. <code class="literal">usage_privileges</code></a></span></dt><dt><span class="sect1"><a href="infoschema-user-defined-types.html">36.56. <code class="literal">user_defined_types</code></a></span></dt><dt><span class="sect1"><a href="infoschema-user-mapping-options.html">36.57. <code class="literal">user_mapping_options</code></a></span></dt><dt><span class="sect1"><a href="infoschema-user-mappings.html">36.58. <code class="literal">user_mappings</code></a></span></dt><dt><span class="sect1"><a href="infoschema-view-column-usage.html">36.59. <code class="literal">view_column_usage</code></a></span></dt><dt><span class="sect1"><a href="infoschema-view-routine-usage.html">36.60. <code class="literal">view_routine_usage</code></a></span></dt><dt><span class="sect1"><a href="infoschema-view-table-usage.html">36.61. <code class="literal">view_table_usage</code></a></span></dt><dt><span class="sect1"><a href="infoschema-views.html">36.62. <code class="literal">views</code></a></span></dt></dl></div><a id="id-1.7.6.2" class="indexterm"></a><p>
The information schema consists of a set of views that contain
information about the objects defined in the current database. The
information schema is defined in the SQL standard and can therefore
be expected to be portable and remain stable — unlike the system
catalogs, which are specific to
<span class="productname">PostgreSQL</span> and are modeled after
implementation concerns. The information schema views do not,
however, contain information about
<span class="productname">PostgreSQL</span>-specific features; to inquire
about those you need to query the system catalogs or other
<span class="productname">PostgreSQL</span>-specific views.
</p><div class="note"><h3 class="title">Note</h3><p>
When querying the database for constraint information, it is possible
for a standard-compliant query that expects to return one row to
return several. This is because the SQL standard requires constraint
names to be unique within a schema, but
<span class="productname">PostgreSQL</span> does not enforce this
restriction. <span class="productname">PostgreSQL</span>
automatically-generated constraint names avoid duplicates in the
same schema, but users can specify such duplicate names.
</p><p>
This problem can appear when querying information schema views such
as <code class="literal">check_constraint_routine_usage</code>,
<code class="literal">check_constraints</code>, <code class="literal">domain_constraints</code>, and
<code class="literal">referential_constraints</code>. Some other views have similar
issues but contain the table name to help distinguish duplicate
rows, e.g., <code class="literal">constraint_column_usage</code>,
<code class="literal">constraint_table_usage</code>, <code class="literal">table_constraints</code>.
</p></div></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ecpg-develop.html" title="35.16. Internals">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="client-interfaces.html" title="Part IV. Client Interfaces">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="infoschema-schema.html" title="36.1. The Schema">Next</a></td></tr><tr><td width="40%" align="left" valign="top">35.16. Internals </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 13.4 Documentation">Home</a></td><td width="40%" align="right" valign="top"> 36.1. The Schema</td></tr></table></div></body></html>
|