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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Siew Hui, Wong" <shwong(at)sebasasia(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Error in function to pg_dump: Standard in must be a tty
Date: 2004-04-12 05:27:42
Message-ID: 565.1081747662@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Siew Hui, Wong" <shwong(at)sebasasia(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tumurbaatar S. 2004-04-12 06:36:30 Regular expressions
Previous Message Tom Lane 2004-04-12 04:16:55 Re: Sorting in Unicode not working