CompTIA DataSys+ (DS0-002) Practice Questions

CompTIA DataSys+ (DS0-002 V2) exam preparation

CompTIA DataSys+ (DS0-002) practice questions in English: 180 questions with explanations. The mock exam has 90 questions and 90 minutes.

CompTIA DataSys+ (DS0-002) free question 2 / 10 · Domain 1: Database Fundamentals

A deployment script must behave the same on every host, whatever personal settings a user keeps in the psql start-up files. Which option protects it?

  1. -b, which skips the system-wide and personal start-up files
  2. -x, which skips the system-wide and personal start-up files
  3. -c, which skips the system-wide and personal start-up files
  4. -X, which skips the system-wide and personal start-up files
Show the answer and explanation

Answer: D

Why this is correct
The psql page describes -X or --no-psqlrc as not reading the start-up file, neither the system-wide psqlrc file nor the user ~/.psqlrc file. A script that must give the same result on every host should not inherit personal formatting or settings, so it starts psql with this option. The similar-looking lowercase -x is a formatting option. The source reads: "Do not read the start-up file (neither the system-wide psqlrc file nor the user's ~/.psqlrc file)." Source page: psql, section "Options".

Why the other options are wrong
"-x, which skips the system-wide and personal start-up files" … The lowercase -x turns on expanded table formatting. The capital -X is the option that skips the start-up files.
"-b, which skips the system-wide and personal start-up files" … The -b option echoes failed SQL commands to standard error. It does not affect start-up files.
"-c, which skips the system-wide and personal start-up files" … The -c option runs a command string. It does not change which start-up files are read.

Key points
Use psql -X in scripts so personal start-up files cannot change their behavior.

Go to the CompTIA DataSys+ (DS0-002) practice app (10 free questions; purchase unlocks all questions)

See the full practice set