From: | Joel Dudley <Joel(dot)Dudley(at)DevelopOnline(dot)com> |
---|---|
To: | "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org> |
Subject: | undefined symbol in create new function |
Date: | 2001-03-28 18:25:38 |
Message-ID: | A04BDD2C264AD41181C000508BDCB72A4F2B98@USAZDOLEXCH0 |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hello all,
I am back with my silly little snippet of code. When I try to create a
function with the following code compiled in to an .so:
#include <string.h>
#include <stdlib.h>
#include "postgres.h"
#include "fmgr.h"
PG_FUNCTION_INFO_V1(ssh_exec);
Datum
ssh_exec(PG_FUNCTION_ARGS)
{
char *uname = PG_GETARG_CHAR(0);
char *uid = PG_GETARG_CHAR(1);
char *gid = PG_GETARG_CHAR(2);
char sshcmd[255];
strncpy(sshcmd, "/usr/local/bin/plsshexec ", 255);
strncat(sshcmd, VARDATA(uname), VARSIZE(uname));
strncat(sshcmd, " ", 255);
strncat(sshcmd, VARDATA(uid), VARSIZE(uid));
strncat(sshcmd, " ", 255);
strncat(sshcmd, VARDATA(gid), VARSIZE(gid));
system(sshcmd);
return 0;
}
I get the following error:
undefined symbol PG_GETARG_CHAR
Is PG_GETARG_CHAR valid? I thought it was. maybe I should re-do it all with
PG_GETARG_TEXT. Thanks for reading my post.
- Joel
From | Date | Subject | |
---|---|---|---|
Next Message | Jason Earl | 2001-03-28 18:34:43 | Re: how to load a sql-file???? |
Previous Message | Mihai Gheorghiu | 2001-03-28 18:04:01 | View primary key |