* Handle function, procedure, and trigger calls. */
| 34 | * Handle function, procedure, and trigger calls. |
| 35 | */ |
| 36 | Datum |
| 37 | plsample_call_handler(PG_FUNCTION_ARGS) |
| 38 | { |
| 39 | Datum retval = (Datum) 0; |
| 40 | |
| 41 | PG_TRY(); |
| 42 | { |
| 43 | /* |
| 44 | * Determine if called as function or trigger and call appropriate |
| 45 | * subhandler. |
| 46 | */ |
| 47 | if (CALLED_AS_TRIGGER(fcinfo)) |
| 48 | { |
| 49 | /* |
| 50 | * This function has been called as a trigger function, where |
| 51 | * (TriggerData *) fcinfo->context includes the information of the |
| 52 | * context. |
| 53 | */ |
| 54 | } |
| 55 | else if (CALLED_AS_EVENT_TRIGGER(fcinfo)) |
| 56 | { |
| 57 | /* |
| 58 | * This function is called as an event trigger function, where |
| 59 | * (EventTriggerData *) fcinfo->context includes the information |
| 60 | * of the context. |
| 61 | */ |
| 62 | } |
| 63 | else |
| 64 | { |
| 65 | /* Regular function handler */ |
| 66 | retval = plsample_func_handler(fcinfo); |
| 67 | } |
| 68 | } |
| 69 | PG_FINALLY(); |
| 70 | { |
| 71 | } |
| 72 | PG_END_TRY(); |
| 73 | |
| 74 | return retval; |
| 75 | } |
| 76 | |
| 77 | /* |
| 78 | * plsample_func_handler |
nothing calls this directly
no test coverage detected