[GENERAL] archive_command

2010-05-31 Thread Jun Wang
Where can I find an example shell script and windows batch file for
archive_command for backup?

Thanks.

Jack

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] archive_command

2010-06-01 Thread Jun Wang
The document recommends a command as below:

archive_command = 'test ! -f /var/lib/pgsql/backup_in_progress || cp
-i %p /var/lib/pgsql/archive/%f < /dev/null'

How can this be done using windows batch? I tried the following
command, but it did not work:

archive_command = 'if not exist C:\\pgsql\\backup_in_progress || copy
%p C:\\pgsqlarchive\\%f'

The error is:

|| was unexpected at this time.

Thanks.

Jack

On Mon, May 31, 2010 at 5:40 PM, Kenichiro Tanaka
 wrote:
> Hello
>
> In my environment,archive_command works fine with this command.
>
> archive_command = 'COPY %p C:\\Program
> Files\\PostgreSQL\\8.4\\data\\archive\\%f'
>
> (Is this what you want to know?)
>
>> Where can I find an example shell script and windows batch file for
>> archive_command for backup?
>>
>> Thanks.
>>
>> Jack
>>
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] set statement_timeout does not work

2010-03-29 Thread Jun Wang
Hi,

I try to set the statement_timeout so that "select pg_stop_backup();"
will not hang if archive command failed. Below are the command and
errors.

psql.exe" -d mydb -h myhost -p 5432 -U postgres -w -c "set
statement_timeout = 1000; select pg_stop_backup();"
WARNING:  pg_stop_backup still waiting for archive to complete (60
seconds elapsed)
WARNING:  pg_stop_backup still waiting for archive to complete (120
seconds elapsed)
WARNING:  pg_stop_backup still waiting for archive to complete (240
seconds elapsed)
WARNING:  pg_stop_backup still waiting for archive to complete (480
seconds elapsed)


I also tried to run the two commands seperately as below. It also does not work.

psql.exe" -d mydb -h myhost -p 5432 -U postgres -w -c "set
statement_timeout = 1000;"
psql.exe" -d mydb -h myhost -p 5432 -U postgres -w -c "select pg_stop_backup();"

If I change the "statement_timeout" setting of postgresql.conf, it
works. But it will afftect all the queries.

How to use psql to do it?

Thanks.

Jack

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] set statement_timeout does not work

2010-03-30 Thread Jun Wang
Hi,

I try to set the statement_timeout so that "select pg_stop_backup();"
will not hang if archive command failed. Below are the command and

Can somebody help on this?

Thanks.


    * From: Jun Wang 
* To: pgsql-general@postgresql.org
* Subject: set statement_timeout does not work
* Date: Mon, 29 Mar 2010 19:33:55 -0700
* Message-id: 


Hi,

I try to set the statement_timeout so that "select pg_stop_backup();"
will not hang if archive command failed. Below are the command and
errors.

psql.exe" -d mydb -h myhost -p 5432 -U postgres -w -c "set
statement_timeout = 1000; select pg_stop_backup();"
WARNING:  pg_stop_backup still waiting for archive to complete (60
seconds elapsed)
WARNING:  pg_stop_backup still waiting for archive to complete (120
seconds elapsed)
WARNING:  pg_stop_backup still waiting for archive to complete (240
seconds elapsed)
WARNING:  pg_stop_backup still waiting for archive to complete (480
seconds elapsed)


I also tried to run the two commands seperately as below. It also does not work.

psql.exe" -d mydb -h myhost -p 5432 -U postgres -w -c "set
statement_timeout = 1000;"
psql.exe" -d mydb -h myhost -p 5432 -U postgres -w -c "select pg_stop_backup();"

If I change the "statement_timeout" setting of postgresql.conf, it
works. But it will afftect all the queries.

How to use psql to do it?

Thanks.

Jack

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general