Bird
0
0

Which of the following is the correct SQL command to create a foreign server named myserver using the postgres_fdw wrapper?

easy📝 Syntax Q12 of 15
PostgreSQL - Advanced Features
Which of the following is the correct SQL command to create a foreign server named myserver using the postgres_fdw wrapper?
ACREATE FOREIGN SERVER myserver FOREIGN DATA WRAPPER postgres_fdw;
BCREATE SERVER myserver FOREIGN DATA WRAPPER postgres_fdw;
CCREATE SERVER myserver USING FOREIGN DATA WRAPPER postgres_fdw;
DCREATE FOREIGN SERVER myserver USING postgres_fdw;
Step-by-Step Solution
Solution:
  1. Step 1: Recall correct syntax for creating foreign server

    The correct syntax is: CREATE FOREIGN SERVER server_name FOREIGN DATA WRAPPER wrapper_name;
  2. Step 2: Match options to syntax

    CREATE FOREIGN SERVER myserver FOREIGN DATA WRAPPER postgres_fdw; matches exactly. Options A and C miss the FOREIGN keyword before SERVER. CREATE FOREIGN SERVER myserver USING postgres_fdw; uses USING incorrectly.
  3. Final Answer:

    CREATE FOREIGN SERVER myserver FOREIGN DATA WRAPPER postgres_fdw; -> Option A
  4. Quick Check:

    CREATE FOREIGN SERVER ... FOREIGN DATA WRAPPER ... [OK]
Quick Trick: Use CREATE FOREIGN SERVER ... FOREIGN DATA WRAPPER ... [OK]
Common Mistakes:
  • Omitting FOREIGN keyword before SERVER
  • Using USING instead of FOREIGN DATA WRAPPER
  • Mixing order of keywords

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes