Skip site navigation (1) Skip section navigation (2)

Re: json api WIP patch

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: james(at)mansionfamily(dot)plus(dot)com
Cc: Merlin Moncure <mmoncure(at)gmail(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: json api WIP patch
Date: 2013-01-08 20:26:36
Message-ID: 50EC80FC.1040706@dunslane.net (view raw or flat)
Thread:
Lists: pgsql-hackers
On 01/08/2013 03:07 PM, james wrote:
>
>
> Yes - but I don't think I can use COPY from a stored proc context can 
> I?  If I could use binary COPY from a stored proc that has received a 
> binary param and unpacked to the data, it would be handy.
>

You can use COPY from a stored procedure, but only to and from files.

> If SPI provided a way to perform a copy to a temp table and then some 
> callback on an iterator that yields rows to it, that would do the 
> trick I guess.

SPI is useful, but it's certainly possible to avoid its use. After all, 
that what almost the whole backend does, including the COPY code. Of 
course, it's a lot harder to write that way, which is part of why SPI 
exists. Efficiency has its price.


cheers

andrew


In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2013-01-08 20:27:23
Subject: Re: [PATCH 2/5] Make relpathbackend return a statically result instead of palloc()'ing it
Previous:From: Andrew DunstanDate: 2013-01-08 20:22:13
Subject: Re: json api WIP patch

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group