Postgresql easy
By default, if you create a database object (like a table) without qualifying it with a schema name, where does it reside?
- A In the `system` schema, alongside the internal catalog and metadata tables.
- B In the `public` schema, which is the default for newly created databases.
- C In the `local` schema, which is isolated from other users in the cluster.
- D It remains 'Unassigned' until the `search_path` is explicitly configured.
Answer: B. In the `public` schema, which is the default for newly created databases.
PostgreSQL uses an organizational hierarchy: Cluster -> Database -> Schema -> Table. The `public` schema is included in the default `search_path`, acting as the primary namespace for user-defined objects.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- In a PostgreSQL environment, what functional characteristic distinguishes a `MATERIALIZED VIEW` from a standard `VIEW`?
- Which standard PostgreSQL utility is designed to extract a single database into a script or archive file for backup purposes?
- Why would PostgreSQL reject a `DELETE` operation on a record despite the user having full administrative privileges?
- The 'Heap Only Tuples' (HOT) optimization improves UPDATE performance. Which specific set of conditions must be met for a HOT update to occur?
- Which native command-line utility is used to execute SQL queries and manage PostgreSQL databases from a terminal session?
- What is the specific purpose of 'Freezing' a row (modifying its `xmin` status) during a major VACUUM operation?