Chapter 33. The Information Schema

Table of Contents
33.1. The Schema
33.2. Data Types
33.3. information_schema_catalog_name
33.4. administrable_role_authorizations
33.5. applicable_roles
33.6. attributes
33.7. character_sets
33.8. check_constraint_routine_usage
33.9. check_constraints
33.10. collations
33.11. collation_character_set_applicability
33.12. column_domain_usage
33.13. column_privileges
33.14. column_udt_usage
33.15. columns
33.16. constraint_column_usage
33.17. constraint_table_usage
33.18. data_type_privileges
33.19. domain_constraints
33.20. domain_udt_usage
33.21. domains
33.22. element_types
33.23. enabled_roles
33.24. foreign_data_wrapper_options
33.25. foreign_data_wrappers
33.26. foreign_server_options
33.27. foreign_servers
33.28. foreign_table_options
33.29. foreign_tables
33.30. key_column_usage
33.31. parameters
33.32. referential_constraints
33.33. role_column_grants
33.34. role_routine_grants
33.35. role_table_grants
33.36. role_usage_grants
33.37. routine_privileges
33.38. routines
33.39. schemata
33.40. sequences
33.41. sql_features
33.42. sql_implementation_info
33.43. sql_languages
33.44. sql_packages
33.45. sql_parts
33.46. sql_sizing
33.47. sql_sizing_profiles
33.48. table_constraints
33.49. table_privileges
33.50. tables
33.51. triggered_update_columns
33.52. triggers
33.53. usage_privileges
33.54. user_mapping_options
33.55. user_mappings
33.56. view_column_usage
33.57. view_routine_usage
33.58. view_table_usage
33.59. views

Note: The following description applies both to Postgres-XC and PostgreSQL if not described explicitly.

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 Postgres-XC and are modelled after implementation concerns. The information schema views do not, however, contain information about Postgres-XC-specific features; to inquire about those you need to query the system catalogs or other PostgreSQL-specific views.

Note: 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 Postgres-XC does not enforce this restriction. PostgreSQL automatically-generated constraint names avoid duplicates in the same schema, but users can specify such duplicate names.

This problem can appear when querying information schema views such as check_constraint_routine_usage, check_constraints, domain_constraints, and referential_constraints. Some other views have similar issues but contain the table name to help distinguish duplicate rows, e.g., constraint_column_usage, constraint_table_usage, table_constraints.