Sample Exam Questions

From the objective of OSS-DB Exam Silver
- Operation and Management - Basic Operation Management Work (Information Schema and System Catalog)

Sample Question

1.09

Choose the correct description for the system catalog which stores information about tables and columns in the database.

  1. The table information is stored in pg_tables, and the column information is stored in pg_columns.
  2. The table information is stored in pg_relations, and the column information is stored in pg_relcolumns.
  3. The table information is stored in pg_class, and the column information is stored in pg_attribute.
  4. Table information is stored in pg_table_info, and column information is stored in pg_table_columns. 
  5. The table information is stored in pg_rel_info, and the column information is stored in pg_col_info. 

※This sample exam is different from those that appear in the actual OSS-DB Exam.
2019/03/04

Answer and Explanation

The system catalog contains information about various objects in the database. 

pg_class contains information about the table and objects (views, sequences, materialized views) related to the table(having column). 

Information about the columns of the table is stored in the system catalog named pg_attribute, and one row is created in pg_attribute for one column. 

Names starting with other pg_s in the choice may seem to be likable, but there are only two system catalogs, pg_class and pg_attribute. pg_tables provides some useful information about the table, but it is called a system view and it is a view that combines multiple system catalogs.  Others do not exist on the system. 

Therefore, the correct answer is C. 

 For details of each system catalog, please refer to https://www.postgresql.org/docs/9.5/static/catalogs.html.