Re: Error in function to pg_dump: Standard in must be a tty

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Error in function to pg_dump: Standard in must be a tty
Дата
Msg-id 565.1081747662@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Error in function to pg_dump: Standard in must be a tty  ("Siew Hui, Wong" <shwong@sebasasia.com>)
Список pgsql-general
"Siew Hui, Wong" <shwong@sebasasia.com> writes:
> Is it possible that there is a permission problem etc that don't allow
> plperlu function that calls a pg_dump command? I am still stumped, trying to
> solve the problem of "Standard in must be a tty" whenever i triggered the
> plperlu function :(

I'd guess that that complaint is coming from /bin/su because it's not
finding anyplace to ask for the password.  But why are you trying to su
to postgres at all?  Anything the backend launches will be running as
the postgres user to start with.

The entire project seems fatally flawed anyway ... you can't seriously
think it's a good idea to launch a complete-database pg_dump after every
row insertion.  Quite aside from the performance implications, you
won't even manage to achieve what you presumably want, because the
pg_dump run is executed before the row-inserting transaction commits,
and so it won't include that new row.

I'd counsel thinking about launching periodic pg_dumps via a cron job,
or some such, instead.  Also see the various replication tools that are
available.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Sorting in Unicode not working
Следующее
От: "Tumurbaatar S."
Дата:
Сообщение: Regular expressions