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

From: "Siew Hui, Wong" <shwong(at)sebasasia(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Error in function to pg_dump: Standard in must be a tty
Date: 2004-04-12 03:37:45
Message-ID: 001e01c4203f$8c7bd250$3c0a0a0a@siewhui
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi again,

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 :(

Any advice is greatly appreciated. Thank you in advance.

best regards,
siew hui

----- Original Message -----
From: "Siew Hui, Wong" <shwong(at)sebasasia(dot)com>
Sent: Friday, April 09, 2004 11:27 AM
Subject: [GENERAL] Error in function to pg_dump: Standard in must be a tty

> Postgresql 7.3.4
> RH 8.0
>
> Hello all,
>
> The client requirements are that from the website(a coldfusionmx app),
they
> could backup and restore the database from the list of backups available.
> All i've given to work on is just that to allow user to select backup to
> restore and also to allow user to perform a manual database backup.
>
> Here's how the "manual backup" process goes. When user clicks on "Backup
> Database Now", a row is inserted to a table (app_dbactionb) to trigger off
> the pg_dump. Problem is an error msg appeared when i insert test data into
> table:
>
> "standard in must be a tty."
>
> Below are the functions and trigger concerned:
> ###################################
> CREATE TRIGGER autobackup
> AFTER INSERT ON app_dbactionb
> FOR EACH ROW
> EXECUTE PROCEDURE initbackup ();
>
>
> CREATE FUNCTION initbackup () RETURNS "trigger" AS '
> begin
> perform Backup ();
> return NEW;
> end;
> ' LANGUAGE 'plpgsql';
>
>
> CREATE FUNCTION backup () RETURNS integer
> AS '
> system("/home/postgres/testbackupdb");
> return 0;
> 'LANGUAGE plperlu;
> ###################################
>
> Below is the testbackupdb (chmod 777, owner postgres):
>
> #!/bin/bash
> #File is named according to abbreviation of week name (Sun...Sat)
> #e.g. nsvm_Mon_2004.db
>
> backupdate=`date +%a_%Y`
> /bin/su - postgres -c "/usr/local/pgsql/bin/pg_dump -f
> /home/postgres/nsvm_$backupdate.db nsvm"
> echo "Backup at `date` :
> nsvm_$backupdate.db">>/home/postgres/nsvm_backup_log
>
>
> I really appreciate any form of advice and feedback on this error. Please
> let me know too, if there are more efficient ways to allow user to backup
> from a webpage :) Thank you all for the time.
>
>
> Best regards,
> siew hui

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Hitesh Bagadiya 2004-04-12 03:43:52 Re: Sorting in Unicode not working
Previous Message Tom Lane 2004-04-12 03:34:18 Re: REINDEX slow?