PostgreSQL Objective Questions & Answers for Practitioners Set-3
1. Which PostgreSQL extension is used for managing table partitioning?
Explanation: A primary key constraint is a combination of a unique constraint and a NOT NULL constraint. It ensures both uniqueness and non-nullability for the specified column(s).
2. In PostgreSQL, what is the autovacuum process responsible for?
Explanation: The autovacuum process in PostgreSQL is responsible for automatically managing the vacuuming and analyzing of tables to reclaim space from dead rows and update statistics.
3. Which PostgreSQL extension provides support for full-text search?
Explanation: The pg_trgm extension in PostgreSQL provides support for full-text search using trigram-based indexing, allowing efficient search operations on textual data.
4. What is the purpose of the pg_roles system catalog in PostgreSQL?
Explanation: The pg_roles system catalog in PostgreSQL stores information about database roles, including the privileges and attributes associated with each role.
5. Which PostgreSQL authentication method uses the operating system user account for authentication?
Explanation: The Peer authentication method in PostgreSQL uses the operating system user account to authenticate connections, allowing users with the same OS username to connect to the database without a password.
6. What is the purpose of the pg_xlog directory in PostgreSQL?
Explanation: The pg_xlog directory in PostgreSQL is used to store archived transaction log files, which are essential for point-in-time recovery and replication.
7. Which PostgreSQL system catalog contains information about database indexes?
Explanation: The pg_index system catalog in PostgreSQL contains information about database indexes, including the columns that are indexed and other related details.
8. In PostgreSQL, what is the purpose of the pg_restore utility?
Explanation: The pg_restore utility in PostgreSQL is used to restore a logical backup of a PostgreSQL database, including its data and schema.
9. Which PostgreSQL command is used to create a new schema?
Explanation: The CREATE SCHEMA command in PostgreSQL is used to create a new schema within a database, providing a logical container for database objects.
10. What is the purpose of the pg_cron extension in PostgreSQL?
Explanation: The pg_cron extension in PostgreSQL allows you to schedule and run periodic tasks (cron jobs) directly within the database, providing a convenient way to automate administrative tasks.
11. In PostgreSQL, what is a "TOAST" table?
Explanation: In PostgreSQL, the "TOAST" (The Oversized-Attribute Storage Technique) mechanism is used to store large objects, such as binary data, in separate tables to optimize storage and retrieval.
12. Which PostgreSQL data type is used to store date and time information with time zone?
Explanation: The TIMESTAMPTZ data type in PostgreSQL is used to store date and time information with time zone.
13. Which PostgreSQL function is used to generate a universally unique identifier (UUID)?
Explanation: The uuid_v4 function in PostgreSQL is used to generate a universally unique identifier (UUID) following the version 4 (random) UUID specification.
14. What is the purpose of the pg_sequence system catalog in PostgreSQL?
Explanation: The pg_sequence system catalog in PostgreSQL stores information about sequence objects, which are often used to generate unique integer values.
15. Which PostgreSQL function is used to convert a value to a different data type?
Explanation: The CAST function in PostgreSQL is used to convert a value to a different data type, allowing you to perform type conversions in SQL expressions.
Related content
Rate Your Experience
: 89
: 1