Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Rafael Martinez <r.m.guerrero@xxxxxxxxxxx> 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 of the text result correctly.  As is, you're
returning a 252-byte result containing embedded nulls and random
garbage.  Embedded nulls, in particular, are verboten.

The fixed-size palloc is okay (as long as you're sure it's enough),
but the length word should only count valid data.

			regards, tom lane


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux