Postgresql easy
Why would PostgreSQL reject a `DELETE` operation on a record despite the user having full administrative privileges?
- A The record contains special characters that are not supported by the local UTF-8 character set.
- B The operation would violate referential integrity enforced by an existing Foreign Key constraint.
- C The table is currently being scanned by an asynchronous background process like Auto-Analyze.
- D The record was originally created by a different system user who has since been deactivated.
Answer: B. The operation would violate referential integrity enforced by an existing Foreign Key constraint.
Foreign Keys prevent data corruption by ensuring that you don't delete 'Parent' records that are still referenced by 'Child' records. This maintains the consistency of the relational data model.
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?
- 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?
- In the context of PostgreSQL storage management, what is the primary objective of the `VACUUM` command?