Re: How to return a large String with C

Поиск
Список
Период
Сортировка
Искать
От
Stefan Niantschur
Тема
Re: How to return a large String with C
Дата
Msg-id
20080217181329.6b0fa26d@trabant.niantschur.de
Ответ на
Список
Дерево обсуждения
How to return a large String with C Stefan Niantschur <sniantschur@web.de>
Re: How to return a large String with C Tom Lane <tgl@sss.pgh.pa.us>
Re: How to return a large String with C Stefan Niantschur <sniantschur@web.de>
Re: How to return a large String with C Tom Lane <tgl@sss.pgh.pa.us>
Re: How to return a large String with C Stefan Niantschur <sniantschur@web.de>
Re: How to return a large String with C Tom Lane <tgl@sss.pgh.pa.us>
Re: How to return a large String with C Stefan Niantschur <sniantschur@web.de>
Re: How to return a large String with C (solved) Stefan Niantschur <sniantschur@web.de>
Re: How to return a large String with C "Vyacheslav Kalinin" <vka@mgcp.com>
Re: How to return a large String with C Colin Wetherbee <cww@denterprises.org>
Am Sun, 17 Feb 2008 09:17:08 -0500
schrieb Tom Lane :

> Stefan Niantschur  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.
> 
> 			regards, tom lane

Yes, I know, but the backend does not allow for a bigger buffer. Trying
to use a 80K (char[81920])buffer did not work and returns:
INFO:  string-size : 48015
INFO:  +++++++++++++++++++++++++++
server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
The connection to the server was lost. Attempting reset: Succeeded.


The surprising thing is that the data can be displayed using elog but
not returend with a string pointer.

Is there any good example which I could read?

Best Regards,
Stefan
В списке pgsql-general по дате отправления
От: Colin Wetherbee
Дата:
От: Vyacheslav Kalinin
Дата:
FAQ