Skip site navigation (1) Skip section navigation (2)

Re: Passing character data to C function

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Philip Compton <pcompton(at)mcs(dot)vuw(dot)ac(dot)nz>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Passing character data to C function
Date: 2002-10-07 19:23:21
Message-ID: Pine.LNX.4.44.0210072040320.928-100000@localhost.localdomain (view raw or flat)
Thread:
Lists: pgsql-bugs
Philip Compton writes:

> CREATE FUNCTION pc_fn(char(50), char(50), char(255)) RETURNS Boolean
> AS '/u/students/pcompton/comp442/ass4/pc_fn.so' LANGUAGE 'C';
>
> //C function prototype
> int pc_fn(char* a1,char* a2,char* a3){...}
> or
> int pc_fn(char a1[50],char a2[50],char a3[255]){...}
>
> fails to work. The function _is_ called and I can _log output_ as it executes,
> but no character data shows up in the arguments.

Have you read the documentation?  That works a lot better than making
stuff up and wondering why it doesn't work.  ;-)

-- 
Peter Eisentraut   peter_e(at)gmx(dot)net


In response to

pgsql-bugs by date

Next:From: Peter EisentrautDate: 2002-10-07 19:23:42
Subject: Re: unable to build on openbsd-sparc
Previous:From: Lee KindnessDate: 2002-10-07 15:17:54
Subject: Re: postmaster will not start with stale lockfile but not report why

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group