diff options
Diffstat (limited to 'contrib/spi')
-rw-r--r-- | contrib/spi/autoinc.c | 2 | ||||
-rw-r--r-- | contrib/spi/insert_username.c | 2 | ||||
-rw-r--r-- | contrib/spi/moddatetime.c | 2 | ||||
-rw-r--r-- | contrib/spi/refint.c | 7 | ||||
-rw-r--r-- | contrib/spi/timetravel.c | 12 |
5 files changed, 5 insertions, 20 deletions
diff --git a/contrib/spi/autoinc.c b/contrib/spi/autoinc.c index 54bbc4345c..41eae4fdc4 100644 --- a/contrib/spi/autoinc.c +++ b/contrib/spi/autoinc.c @@ -12,8 +12,6 @@ PG_MODULE_MAGIC; -extern Datum autoinc(PG_FUNCTION_ARGS); - PG_FUNCTION_INFO_V1(autoinc); Datum diff --git a/contrib/spi/insert_username.c b/contrib/spi/insert_username.c index 3bc51c7f02..875207881a 100644 --- a/contrib/spi/insert_username.c +++ b/contrib/spi/insert_username.c @@ -17,8 +17,6 @@ PG_MODULE_MAGIC; -extern Datum insert_username(PG_FUNCTION_ARGS); - PG_FUNCTION_INFO_V1(insert_username); Datum diff --git a/contrib/spi/moddatetime.c b/contrib/spi/moddatetime.c index 2ec9654036..c6d33b7355 100644 --- a/contrib/spi/moddatetime.c +++ b/contrib/spi/moddatetime.c @@ -23,8 +23,6 @@ OH, me, I'm Terry Mackintosh <terry@terrym.com> PG_MODULE_MAGIC; -extern Datum moddatetime(PG_FUNCTION_ARGS); - PG_FUNCTION_INFO_V1(moddatetime); Datum diff --git a/contrib/spi/refint.c b/contrib/spi/refint.c index 8dc565a190..2602210741 100644 --- a/contrib/spi/refint.c +++ b/contrib/spi/refint.c @@ -16,10 +16,6 @@ PG_MODULE_MAGIC; -extern Datum check_primary_key(PG_FUNCTION_ARGS); -extern Datum check_foreign_key(PG_FUNCTION_ARGS); - - typedef struct { char *ident; @@ -634,8 +630,7 @@ find_plan(char *ident, EPlan **eplan, int *nplans) (*nplans) = i = 0; } - newp->ident = (char *) malloc(strlen(ident) + 1); - strcpy(newp->ident, ident); + newp->ident = strdup(ident); newp->nplans = 0; newp->splan = NULL; (*nplans)++; diff --git a/contrib/spi/timetravel.c b/contrib/spi/timetravel.c index 34b4453f87..a37cbee863 100644 --- a/contrib/spi/timetravel.c +++ b/contrib/spi/timetravel.c @@ -22,9 +22,6 @@ PG_MODULE_MAGIC; /* AbsoluteTime currabstime(void); */ -Datum timetravel(PG_FUNCTION_ARGS); -Datum set_timetravel(PG_FUNCTION_ARGS); -Datum get_timetravel(PG_FUNCTION_ARGS); typedef struct { @@ -48,17 +45,17 @@ static EPlan *find_plan(char *ident, EPlan **eplan, int *nplans); /* * timetravel () -- - * 1. IF an update affects tuple with stop_date eq INFINITY + * 1. IF an update affects tuple with stop_date eq INFINITY * then form (and return) new tuple with start_date eq current date * and stop_date eq INFINITY [ and update_user eq current user ] * and all other column values as in new tuple, and insert tuple * with old data and stop_date eq current date * ELSE - skip updation of tuple. - * 2. IF an delete affects tuple with stop_date eq INFINITY + * 2. IF an delete affects tuple with stop_date eq INFINITY * then insert the same tuple with stop_date eq current date * [ and delete_user eq current user ] * ELSE - skip deletion of tuple. - * 3. On INSERT, if start_date is NULL then current date will be + * 3. On INSERT, if start_date is NULL then current date will be * inserted, if stop_date is NULL then INFINITY will be inserted. * [ and insert_user eq current user, update_user and delete_user * eq NULL ] @@ -540,8 +537,7 @@ find_plan(char *ident, EPlan **eplan, int *nplans) (*nplans) = i = 0; } - newp->ident = (char *) malloc(strlen(ident) + 1); - strcpy(newp->ident, ident); + newp->ident = strdup(ident); newp->splan = NULL; (*nplans)++; |