Re: Sending messages inside a function

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Sending messages inside a function
Дата
Msg-id 8583.1133288898@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Sending messages inside a function  (Chris Campbell <chris@bignerdranch.com>)
Ответы Re: Sending messages inside a function
Список pgsql-interfaces
Chris Campbell <chris@bignerdranch.com> writes:
> I'm trying to write a set of C functions that mimic the COPY TO and  
> COPY FROM SQL commands so I can use them to stream binary data to/ 
> from the client.

You cannot control the FE/BE protocol from inside a user function.

> This seems more efficient to me than passing BYTEAs back and forth.  

Why?  A byte is a byte.  There is no possible way that you will ever
save enough microseconds from this to repay the development time you
will waste trying to kluge the system to do it.

If it's the overhead of parsing the SELECT you are unhappy with,
you could look at using the "fast path" function call protocol
to invoke your functions.
        regards, tom lane


В списке pgsql-interfaces по дате отправления:

Предыдущее
От: Chris Campbell
Дата:
Сообщение: Sending messages inside a function
Следующее
От: Chris Campbell
Дата:
Сообщение: Re: Sending messages inside a function