Skip to content

Commit

Permalink
Add a plperl6_func_handler skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
leto committed Jun 9, 2010
1 parent f4b60a2 commit 3f8e574
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions plparrot.c
Expand Up @@ -165,6 +165,7 @@ Datum plperl6_call_handler(PG_FUNCTION_ARGS);
Datum plperl6u_call_handler(PG_FUNCTION_ARGS);

static Datum plparrot_func_handler(PG_FUNCTION_ARGS);
static Datum plperl6_func_handler(PG_FUNCTION_ARGS);
static Datum plparrotu_func_handler(PG_FUNCTION_ARGS);

/* The PostgreSQL function+trigger managers call this function for execution
Expand All @@ -175,6 +176,13 @@ PG_FUNCTION_INFO_V1(plparrotu_call_handler);
PG_FUNCTION_INFO_V1(plperl6_call_handler);
PG_FUNCTION_INFO_V1(plperl6u_call_handler);

static Datum
plperl6_func_handler(PG_FUNCTION_ARGS)
{
Datum retval, procsrc_datum;
retval = PG_GETARG_DATUM(0);
return retval;
}
static Datum
plparrotu_func_handler(PG_FUNCTION_ARGS)
{
Expand Down Expand Up @@ -351,6 +359,21 @@ Datum
plperl6_call_handler(PG_FUNCTION_ARGS)
{
Datum retval = 0;
TriggerData *tdata;
PG_TRY();
{
if (CALLED_AS_TRIGGER(fcinfo)) {
tdata = (TriggerData *) fcinfo->context;
/* TODO: we need a trigger handler */
} else {
retval = plperl6_func_handler(fcinfo);
}
}
PG_CATCH();
{
PG_RE_THROW();
}
PG_END_TRY();
return retval;
}

Expand Down

0 comments on commit 3f8e574

Please sign in to comment.