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 |
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 по дате отправления: