Bird
0
0

Which command is used to detach a partition from a partitioned table in PostgreSQL?

easy📝 Conceptual Q2 of 15
PostgreSQL - Table Partitioning
Which command is used to detach a partition from a partitioned table in PostgreSQL?
AALTER TABLE ... REMOVE PARTITION
BALTER TABLE ... DETACH PARTITION
CDROP PARTITION FROM TABLE
DDELETE PARTITION FROM TABLE
Step-by-Step Solution
Solution:
  1. Step 1: Identify the correct syntax for detaching

    PostgreSQL uses ALTER TABLE with DETACH PARTITION to remove a partition.
  2. Step 2: Eliminate incorrect options

    REMOVE PARTITION, DROP PARTITION, DELETE PARTITION are not valid PostgreSQL commands.
  3. Final Answer:

    ALTER TABLE ... DETACH PARTITION -> Option B
  4. Quick Check:

    Detach partition command = ALTER TABLE ... DETACH PARTITION [OK]
Quick Trick: Use ALTER TABLE ... DETACH PARTITION to remove partitions [OK]
Common Mistakes:
  • Using DROP or DELETE instead of DETACH
  • Confusing syntax with other SQL dialects
  • Trying to detach partitions without ALTER TABLE

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes