Bird
0
0

Why does PostgreSQL allow functions with OUT parameters to omit an explicit RETURN statement?

hard📝 Conceptual Q10 of 15
PostgreSQL - Advanced PL/pgSQL
Why does PostgreSQL allow functions with OUT parameters to omit an explicit RETURN statement?
ABecause the function automatically commits changes without RETURN.
BBecause OUT parameters act as implicit return values collected into a record.
CBecause RETURN is only needed for scalar return types.
DBecause OUT parameters are only for input, not output.
Step-by-Step Solution
Solution:
  1. Step 1: Understand OUT parameter behavior

    OUT parameters are assigned inside the function and form the return record automatically.
  2. Step 2: Explain omission of RETURN

    Since OUT parameters define the output, explicit RETURN is not required to send results back.
  3. Final Answer:

    Because OUT parameters act as implicit return values collected into a record. -> Option B
  4. Quick Check:

    OUT parameters = implicit return record [OK]
Quick Trick: OUT parameters implicitly return values without RETURN [OK]
Common Mistakes:
  • Thinking RETURN is always mandatory
  • Confusing OUT parameters with input-only parameters
  • Assuming automatic commit relates to RETURN

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes