Search Postgresql Archives

Re: How to return a large String with C

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

 



Tom Lane wrote:
Stefan Niantschur <sniantschur@xxxxxx> writes:
So far I have been successfully doing calls to SPI, select the data from the table and return it. However, this works only with string not larger than page size of char[8192]. The strings I expect are much longer and this causes the backend to crash.

Hardly surprising when you're printing the string into a fixed-size 8K buffer.
The buffer overflow is smashing the stack, in particular the function's
return address.

He also uses the variable "i" in *both* parts of his nested loop.

Stefan, you should probably pick up a C programming book before going too much further with this.

Colin

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
      choose an index scan if your joining column's datatypes do not
      match

[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