Re: [HACKERS] PL/Perl list value return causes segfault

Поиск
Список
Период
Сортировка
Искать

Re: [HACKERS] PL/Perl list value return causes segfault

От:
David Fetter <david@fetter.org>
Дата:
Вложения:
On Fri, Jul 29, 2005 at 11:24:37PM -0400, Bruce Momjian wrote:
> 
> Would someone who knows perl update plperl.sgml and send me a patch?
> 
> Also, is this still true in 8.1:
> 
>       In the current implementation, if you are fetching or returning
>       very large data sets, you should be aware that these will all go
>       into memory.

That's no longer true.  Please find enclosed a new patch :)

Cheers,
D
-- 
David Fetter david@fetter.org http://fetter.org/
phone: +1 510 893 6100   mobile: +1 415 235 3778

Remember to vote!

Re: [HACKERS] PL/Perl list value return causes segfault

От:
David Fetter <david@fetter.org>
Дата:
Вложения:
On Sat, Jul 30, 2005 at 09:47:58AM -0400, Andrew Dunstan wrote:
> 
> 
> David Fetter wrote:
> 
> You have rolled 2 problems into one - spi_query+spi_fetchrow does not 
> address the issue of returning large data sets.
> 
> Suggest instead:

[suggestion]

Revised patch attached.  Thanks for catching this :)

Cheers,
D
-- 
David Fetter david@fetter.org http://fetter.org/
phone: +1 510 893 6100   mobile: +1 415 235 3778

Remember to vote!

Re: [HACKERS] PL/Perl list value return causes segfault

От:
Andrew Dunstan <andrew@dunslane.net>
Дата:


David Fetter wrote:

>*** 716,724 ****
>  
>      
>       
>!       In the current implementation, if you are fetching or returning
>!       very large data sets, you should be aware that these will all go
>!       into memory.
>       
>      
>     
>--- 766,776 ----
>  
>      
>       
>!       If you are fetching or returning very large data sets using
>!       spi_exec_query, you should be aware that
>!       these will all go into memory.  You can avoid this by using
>!       spi_query/spi_fetchrow as
>!       illustrated earlier.
>       
>      
>     
>  
>
>  
>

You have rolled 2 problems into one - spi_query+spi_fetchrow does not 
address the issue of returning large data sets.

Suggest instead:



       If you are fetching very large data sets using
       spi_exec_query, you should be aware that
       these will all go into memory.  You can avoid this by using
       spi_query and spi_fetchrow 
	as illustrated earlier.


	A similar problem occurs if a set-returning function passes 
	a large set of rows back to postgres via 
	return. You can avoid this 
	problem too by instead using return_next for 
	each row returned, as shown previously.





cheers

andrew

Re: [HACKERS] PL/Perl list value return causes segfault

От:
Bruce Momjian <pgman@candle.pha.pa.us>
Дата:

Patch applied.  Thanks.

---------------------------------------------------------------------------


David Fetter wrote:
> On Sat, Jul 30, 2005 at 09:47:58AM -0400, Andrew Dunstan wrote:
> > 
> > 
> > David Fetter wrote:
> > 
> > You have rolled 2 problems into one - spi_query+spi_fetchrow does not 
> > address the issue of returning large data sets.
> > 
> > Suggest instead:
> 
> [suggestion]
> 
> Revised patch attached.  Thanks for catching this :)
> 
> Cheers,
> D
> -- 
> David Fetter david@fetter.org http://fetter.org/
> phone: +1 510 893 6100   mobile: +1 415 235 3778
> 
> Remember to vote!

[ Attachment, skipping... ]

> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
>        subscribe-nomail command to majordomo@postgresql.org so that your
>        message can get through to the mailing list cleanly

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
FAQ