pg_background extension help
От | Stephen Anderson |
---|---|
Тема | pg_background extension help |
Дата | |
Msg-id | CADn1m+6shOYPrMYdbhHbRa_Wb0xiTX942sQNxPpLZLFOAJqptA@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: pg_background extension help
(Tom Lane <tgl@sss.pgh.pa.us>)
|
Список | pgsql-novice |
select * from testing('x') pv_result | pv_result2
-------------+-------------out value 1 | another out
I want to call this using pg_background and get the value of the two out parameters. Does anyone have any idea what I should use in the as
section of the following query:
select * from pg_background_result(pg_background_launch('exec testing(''x'')')) as (???)
if I run something like:
vacuum verbose <my table>
I get 22 odd lines of guff and then a line with VACUUM on it.
If I run that in pg_background
SELECT * FROM pg_background_result(pg_background_launch('vacuum verbose <my table>')) as (result TEXT);
I get 22 odd lines of guff and then
-[ RECORD 1 ]--
result | VACUUM
(pv_result1 text, pv_result2 text)
and even tried (result text, pv_result1 text, pv_result2 text)
but no luck.That set me on a path of trying to work out what the remote query result rowtype is..
\df+ pg_background_result just tells me the result data type is "SETOF record"..
I tried the functions here: https://stackoverflow.com/questions/34883062/how-to-read-a-function-return-table-definition-from-pg-catalog-or-information-sc which work fine on my dummy procedure:
select proname, function_return_type_names(p)
from pg_proc p
where proname = 'testing';
-[ RECORD 1 ]--------------+------------------
proname | testing
function_return_type_names | {varchar,varchar}
All in all, I'm a bit lost at this point..
Any suggestions most welcome
Steve.
В списке pgsql-novice по дате отправления: