-
Notifications
You must be signed in to change notification settings - Fork 100
Open
Labels
Description
Based on what pgTap functions are available, I thought that you could use all the function testing functions (ie, is_definer()
) to test procedures. Turns out... not so much...
+not ok 1 - Function _task.task__run_for(text, int, task.task_options, boolean) should exist
+# Failed test 1: "Function _task.task__run_for(text, int, task.task_options, boolean) should exist"
+ok 2 - Function task.task__run_for(text, int, task.task_options, boolean) should be a procedure
+not ok 3 - Function _task.task__run_for(text, int, task.task_options, boolean) should be security definer
+# Failed test 3: "Function _task.task__run_for(text, int, task.task_options, boolean) should be security definer"
+# (test result was NULL)
+not ok 4 - Function _task.task__run_for(text, int, task.task_options, boolean) should be VOLATILE
+# Failed test 4: "Function _task.task__run_for(text, int, task.task_options, boolean) should be VOLATILE"
+# Function _task.task__run_for(text, int, task.task_options, boolean) does not exist
+not ok 5 - Function _task.task__run_for(text, int, task.task_options, boolean) should not be strict
+# Failed test 5: "Function _task.task__run_for(text, int, task.task_options, boolean) should not be strict"
+# (test result was NULL)
The two possibilities that come to mind are:
- change the existing functions to recognize both functions and procedures
- create a duplicate set of functions for just procedures
I'm leaning towards 1 just to reduce the number of functions in the extension.