Re: [GENERAL] Problems with a C function, pg_uname(), and String concatenation.

2008-07-01 Thread Tom Lane
Rafael Martinez <[EMAIL PROTECTED]> writes: > We have a function in C which is accessed via a view and which produces > a strange result when used together with || (String concatenation). > I can not find the problem. Any C/postgres guru with any idea of how to > fix it? You need to set the size

Re: [GENERAL] Problems with a C function, pg_uname(), and String concatenation.

2008-07-01 Thread Rafael Martinez
Pavel Stehule wrote: 2008/7/1 Rafael Martinez <[EMAIL PROTECTED]>: Pavel Stehule wrote: hello try memcpy(VARDATA(result),uname_pointer.release,strlen(uname_pointer.release)); SET_VARSIZE(result, strlen(uname_pointer.release) + VARHDRSZ); [.] This a 8.2.x system. SET_VARSIZE is not

Re: [GENERAL] Problems with a C function, pg_uname(), and String concatenation.

2008-07-01 Thread Glyn Astill
> Pavel Stehule wrote: > > hello > > try > > > > memcpy(VARDATA(result),uname_pointer.release,strlen(uname_pointer.release)); > > SET_VARSIZE(result, strlen(uname_pointer.release) + VARHDRSZ); > > > [.] > > This a 8.2.x system. SET_VARSIZE is not available. > > Thanks for your time. >

Re: [GENERAL] Problems with a C function, pg_uname(), and String concatenation.

2008-07-01 Thread Pavel Stehule
2008/7/1 Rafael Martinez <[EMAIL PROTECTED]>: > Pavel Stehule wrote: >> >> hello >> try >> >> >> memcpy(VARDATA(result),uname_pointer.release,strlen(uname_pointer.release)); >> SET_VARSIZE(result, strlen(uname_pointer.release) + VARHDRSZ); >> > [.] > > This a 8.2.x system. SET_VARSIZE is no

Re: [GENERAL] Problems with a C function, pg_uname(), and String concatenation.

2008-07-01 Thread Rafael Martinez
Pavel Stehule wrote: hello try memcpy(VARDATA(result),uname_pointer.release,strlen(uname_pointer.release)); SET_VARSIZE(result, strlen(uname_pointer.release) + VARHDRSZ); [.] This a 8.2.x system. SET_VARSIZE is not available. Thanks for your time. regards -- Rafael Martinez, <[EMAIL

Re: [GENERAL] Problems with a C function, pg_uname(), and String concatenation.

2008-07-01 Thread Pavel Stehule
hello try memcpy(VARDATA(result),uname_pointer.release,strlen(uname_pointer.release)); SET_VARSIZE(result, strlen(uname_pointer.release) + VARHDRSZ); Regards Pave Stehule 2008/7/1 Rafael Martinez <[EMAIL PROTECTED]>: > Hello > > We have a function in C which is accessed via a view and which prod