Re: How can exe files such as 'pg_dump' be called from stored functions?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: How can exe files such as 'pg_dump' be called from stored functions?
Дата
Msg-id 20775.1202437008@sss.pgh.pa.us
обсуждение исходный текст
Ответ на How can exe files such as 'pg_dump' be called from stored functions?  ("Satoru Fukushima" <satoruf@gmail.com>)
Ответы Re: How can exe files such as 'pg_dump' be called from stored functions?
Список pgsql-general
"Satoru Fukushima" <satoruf@gmail.com> writes:
> can execute 'pg_dump', which produces an output file. However, when I
> made it as a stored function in C, it didn't work. Within the stored
> function, I used the exact same 'system' command. The other parts
> within the function such as getting input values, calculating, and
> returning outputs works and no error is produced. It looks that just
> the system("pg_dump"); command is passed without outputting anything.

Are you making any effort at all to check for errors?  It's not apparent
from this code...

The simplest approach to debugging this might be to dump stderr into
some file, say

system("pg_dump -f /path/to/output/file database_name 2>/tmp/pgdumperrs");

and see what ends up in that file.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Test text value as interval
Следующее
От: Steve Crawford
Дата:
Сообщение: Re: How can exe files such as 'pg_dump' be called from stored functions?