Re: Error in function to pg_dump: Standard in must be a tty - Mailing list pgsql-general

From Tom Lane
Subject Re: Error in function to pg_dump: Standard in must be a tty
Date
Msg-id 565.1081747662@sss.pgh.pa.us
Whole thread Raw
In response to Re: Error in function to pg_dump: Standard in must be a tty  ("Siew Hui, Wong" <shwong@sebasasia.com>)
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: Sorting in Unicode not working
Next
From: "Tumurbaatar S."
Date:
Subject: Regular expressions