Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

PostgreSQL PGCES-02 Exam - Topic 10 Question 102 Discussion

Select one incorrect description regarding the following SQL statement defining a function.CREATE OR REPLACE FUNCTION get_file_list(TEXT, BOOLEAN) RETURNS SETOF TEXT LANGUAGE C STRICT SECURITY DEFINER AS 'myfuncs.so';
E) This function operates with the authority of the user who executed it.
A) This function may be defined in 'myfuncs.so'.
B) This function can return multiple rows.
C) This SQL statement defines a function written in the C language.
D) If this function is called with a NULL parameter, it will return 0 when executed.

PostgreSQL PGCES-02 Exam - Topic 10 Question 102 Discussion

Actual exam question for PostgreSQL's PGCES-02 exam
Question #: 102
Topic #: 10
[All PGCES-02 Questions]

Select one incorrect description regarding the following SQL statement defining a function.

CREATE OR REPLACE FUNCTION get_file_list(TEXT, BOOLEAN) RETURNS SETOF TEXT LANGUAGE C STRICT SECURITY DEFINER AS 'myfuncs.so';

Show Suggested Answer Hide Answer
Suggested Answer: E

Contribute your Thoughts:

0/2000 characters
Ahmad
3 days ago
I feel like E is misleading too. It runs with the definer's privileges, not the caller's.
upvoted 0 times
...
Dick
8 days ago
Agreed! It might just return NULL instead.
upvoted 0 times
...
Altha
14 days ago
I think D is incorrect. It won't return 0 with NULL.
upvoted 0 times
...
Loreen
19 days ago
E) I think that's wrong, it should run with the definer's authority.
upvoted 0 times
...
Charolette
24 days ago
D) Wait, what? A NULL parameter returning 0 seems off.
upvoted 0 times
...
Samira
29 days ago
C) Yup, it's definitely written in C.
upvoted 0 times
...
Shizue
1 month ago
B) Totally agree, it can return multiple rows.
upvoted 0 times
...
Kristofer
1 month ago
A) is correct, the function is in 'myfuncs.so'.
upvoted 0 times
...
Mabel
1 month ago
I feel like E is correct too, but I can't recall if SECURITY DEFINER changes that behavior.
upvoted 0 times
...
Keneth
2 months ago
I practiced a similar question where we discussed the RETURN type, and I think B is definitely true since it says SETOF TEXT.
upvoted 0 times
...
Tandra
2 months ago
I think D might be the incorrect one, but I'm not entirely sure how NULL parameters are handled in C functions.
upvoted 0 times
...
Robt
2 months ago
I remember that functions can be defined in external libraries like 'myfuncs.so', so A seems correct.
upvoted 0 times
...

Save Cancel