=?iso-8859-1?Q?C=E9line_Rivi=E8re?= <cr(at)fr(dot)netcentrex(dot)net> writes:
> CREATE FUNCTION Get_Length(TEXT)=20
> RETURNS INTEGER
> AS
> '/home/ncxusers/criviere/TOOLS/lib/tools.so', 'Get_Length'
> LANGUAGE 'C';
> This is the C implementation of GetLength :
> extern "C" Datum file_open (PG_FUNCTION_ARGS)
> {
> char *szName =3D PG_GETARG_CSTRING(0);
> long lgLength =3D strlen(szName);
Type TEXT is not the same as a C string. Look at the builtin functions
that manipulate text arguments.
regards, tom lane