Re: INOUT text[],OUT text parameter handling problem

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: INOUT text[],OUT text parameter handling problem
Дата
Msg-id CAKFQuwb6eismXy74OXa4uE7MqZxXwcOgmDM627i49p95uOLfFA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: INOUT text[],OUT text parameter handling problem  (Michael Moore <michaeljmoore@gmail.com>)
Список pgsql-sql
On Tue, May 24, 2016 at 7:19 PM, Michael Moore <michaeljmoore@gmail.com> wrote:
So, why would anybody ever want an INOUT parameter? Rhetorical question, not expecting an answer. So, since I am going to have to get a copy back from the CALLED function, then I will need to replace the original text[] with the one I got back. It would probably be more efficient to just do the array_append function in the caller and pass the array length to fbind.   

​FWIW the line immediately preceding the one quoted previously was a good opportunity to "call by reference" if it was allowed:

> ​using_values := array_append(using_values, 'the first entry'::text);

array_append is a "pure function"[1] though for non-trivial arrays having mutable properties would be much more efficient.

By the way, not that you should care, but Oracle has an INOUT parameter that does a COPY or you can specify "INOUT NOCOPY" which is of course your call by reference. 

​It helps explain where all these heretical thoughts come from ;)

David J.

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

Предыдущее
От: Michael Moore
Дата:
Сообщение: Re: INOUT text[],OUT text parameter handling problem
Следующее
От: Achilleas Mantzios
Дата:
Сообщение: Array casting in where : unexpected behavior