undefined symbol in create new function - Mailing list pgsql-general

From Joel Dudley
Subject undefined symbol in create new function
Date
Msg-id A04BDD2C264AD41181C000508BDCB72A4F2B98@USAZDOLEXCH0
Whole thread Raw
Responses Re: undefined symbol in create new function
List 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

pgsql-general by date:

Previous
From: "chris markiewicz"
Date:
Subject: fastpath error?
Next
From: Jason Earl
Date:
Subject: Re: how to load a sql-file????