spi_query/spi_fetchrow for pl/perl

Started by Abhijit Menon-Senabout 21 years ago2 messagespatches
Jump to latest
#1Abhijit Menon-Sen
ams@2ndQuadrant.com

The attached patch implements spi_query() and spi_fetchrow() functions
for PL/Perl, to avoid loading the entire result set into memory as the
existing spi_exec_query() function does.

Here's how one might use the new functions:

$x = spi_query("select ...");
while (defined ($y = spi_fetchrow($x))) {
...
return_next(...);
}

The changes do not affect the spi_exec_query() interface in any way.

Comments welcome.

-- ams

Attachments:

spi-query.difftext/plain; charset=us-asciiDownload+124-0
#2Bruce Momjian
bruce@momjian.us
In reply to: Abhijit Menon-Sen (#1)
Re: spi_query/spi_fetchrow for pl/perl

Patch applied. Thanks.

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

Abhijit Menon-Sen wrote:

The attached patch implements spi_query() and spi_fetchrow() functions
for PL/Perl, to avoid loading the entire result set into memory as the
existing spi_exec_query() function does.

Here's how one might use the new functions:

$x = spi_query("select ...");
while (defined ($y = spi_fetchrow($x))) {
...
return_next(...);
}

The changes do not affect the spi_exec_query() interface in any way.

Comments welcome.

-- ams

[ Attachment, skipping... ]

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

-- 
  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