pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedpg_dumpall / pg_dump
7+ messages / 4 participants
[nested] [flat]
* pg_dumpall / pg_dump
@ 2003-05-02 18:31 jonesbl@WellsFargo.COM
0 siblings, 2 replies; 7+ messages in thread
From: jonesbl@WellsFargo.COM @ 2003-05-02 18:31 UTC (permalink / raw)
To: pgsql-admin
Postgres ver. 7.3.1, on HPUX.
I'm having a problem dumping my database using pg_dumpall. The
statement_timeout value is set to 15 minutes, and I don't want to set it
higher (protecting the db against long and/or ill formed queries).
My problem is, the dump takes more that 15 minutes and there doesn't seem to
be any way to temporarily increase the timeout value a la:
& psql -c "set statement_timeout = 0;" <dbname>
& pg_dumpall ...
& psql -c "set statement_timeout = 900000;" <dbname>
I did hack the vacuumdb script to alter the timeout value so VACUUM would
complete (takes 1 hour 30 minutes).
Is there any way to hack pg_dump and pg_dumpall to temporarily increase
statement_timeout limits so backups can complete? Or, better yet, is there
an undocumented command to alter the statement_timeout value during the
dump?
Bill Jones
Systems Architect
Middleware Services
Wells Fargo Services Company
Office --415.243.1364
PCS -- 415.254.3831 (4152543831@mobile.att.net)
Views expressed are mine. Only in unusual circumstances are they shared by
my employer.
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: pg_dumpall / pg_dump
@ 2003-05-02 19:23 Daniel Seichter <daniel@dseichter.de>
parent: jonesbl@WellsFargo.COM
1 sibling, 2 replies; 7+ messages in thread
From: Daniel Seichter @ 2003-05-02 19:23 UTC (permalink / raw)
To: pgsql-admin
Hello,
what do you think about to dump each table with the option t and add the output of the
dump to one file?
Daniel
> Postgres ver. 7.3.1, on HPUX.
>
> I'm having a problem dumping my database using pg_dumpall. The
> statement_timeout value is set to 15 minutes, and I don't want to set
> it higher (protecting the db against long and/or ill formed queries).
>
> My problem is, the dump takes more that 15 minutes and there doesn't
> seem to be any way to temporarily increase the timeout value a la:
>
> & psql -c "set statement_timeout = 0;" <dbname>
> & pg_dumpall ...
> & psql -c "set statement_timeout = 900000;" <dbname>
>
> I did hack the vacuumdb script to alter the timeout value so VACUUM
> would complete (takes 1 hour 30 minutes).
>
> Is there any way to hack pg_dump and pg_dumpall to temporarily
> increase statement_timeout limits so backups can complete? Or, better
> yet, is there an undocumented command to alter the statement_timeout
> value during the dump?
>
>
> Bill Jones
> Systems Architect
> Middleware Services
> Wells Fargo Services Company
> Office --415.243.1364
> PCS -- 415.254.3831 (4152543831@mobile.att.net)
>
> Views expressed are mine. Only in unusual circumstances are they
> shared by my employer.
>
>
> ---------------------------(end of
> broadcast)--------------------------- TIP 6: Have you searched our
> list archives?
>
> http://archives.postgresql.org
--
Eigene Software und Projekte, KI, Links und Sonstiges!
Schauen Sie einfach mal vorbei, unter http://www.dseichter.de
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: pg_dumpall / pg_dump
@ 2003-05-02 21:13 Tom Lane <tgl@sss.pgh.pa.us>
parent: jonesbl@WellsFargo.COM
1 sibling, 0 replies; 7+ messages in thread
From: Tom Lane @ 2003-05-02 21:13 UTC (permalink / raw)
To: jonesbl@WellsFargo.COM; +Cc: pgsql-admin
jonesbl@WellsFargo.COM writes:
> My problem is, the dump takes more that 15 minutes and there doesn't seem to
> be any way to temporarily increase the timeout value a la:
> & psql -c "set statement_timeout = 0;" <dbname>
> & pg_dumpall ...
> & psql -c "set statement_timeout = 900000;" <dbname>
The grotty way is
export PGOPTIONS="--statement_timeout=0"
pg_dumpall
unset PGOPTIONS
A possibly more convenient answer is to set statement_timeout=0 as a
per-user setting for the superuser (see ALTER USER). Or, if you want
the limit to apply to superuser too, create a second superuser account
that you use only for pg_dump, vacuumdb, and similar long jobs.
regards, tom lane
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: pg_dumpall / pg_dump
@ 2003-05-06 14:11 Andrew Sullivan <andrew@libertyrms.info>
parent: Daniel Seichter <daniel@dseichter.de>
1 sibling, 0 replies; 7+ messages in thread
From: Andrew Sullivan @ 2003-05-06 14:11 UTC (permalink / raw)
To: pgsql-admin
On Fri, May 02, 2003 at 09:23:28PM +0200, Daniel Seichter wrote:
> Hello,
>
> what do you think about to dump each table with the option t and
> add the output of the dump to one file?
I think that's a good way to get an inconsistent dump.
A
----
Andrew Sullivan 204-4141 Yonge Street
Liberty RMS Toronto, Ontario Canada
<andrew@libertyrms.info> M2P 2A8
+1 416 646 3304 x110
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: pg_dumpall / pg_dump
@ 2003-05-06 15:41 Daniel Seichter <daniel@dseichter.de>
parent: Daniel Seichter <daniel@dseichter.de>
1 sibling, 1 reply; 7+ messages in thread
From: Daniel Seichter @ 2003-05-06 15:41 UTC (permalink / raw)
To: pgsql-admin
Hello,
> > what do you think about to dump each table with the option t and add
> > the output of the dump to one file?
>
> I think that's a good way to get an inconsistent dump.
and what is a better way if you only need three tables of your database?
Daniel
--
postgreSQL on Netware - the red elephant
http://postgresql.dseichter.org
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: pg_dumpall / pg_dump
@ 2003-05-06 17:55 Daniel Seichter <daniel@dseichter.de>
parent: Daniel Seichter <daniel@dseichter.de>
0 siblings, 1 reply; 7+ messages in thread
From: Daniel Seichter @ 2003-05-06 17:55 UTC (permalink / raw)
To: pgsql-admin
Hello Andrew,
> The most certain way is to do pg_dump in binary mode, and then use the
> catalogue after the fact to import only the target tables. But on a
> live database, three pg_dump -t statements is certain _not_ to get you
> a consistent snapshot. (Of course, if the consistency doesn't matter
> in your case, then it makes no difference.)
I dump the tables at a time, were I am sure, that no user is on the database. The dump
is used for another database, that creates a database with only these three tables.
Daniel
--
postgreSQL on Netware - the red elephant
http://postgresql.dseichter.org
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: pg_dumpall / pg_dump
@ 2003-05-06 19:54 Andrew Sullivan <andrew@libertyrms.info>
parent: Daniel Seichter <daniel@dseichter.de>
0 siblings, 0 replies; 7+ messages in thread
From: Andrew Sullivan @ 2003-05-06 19:54 UTC (permalink / raw)
To: pgsql-admin
On Tue, May 06, 2003 at 07:55:30PM +0200, Daniel Seichter wrote:
> I dump the tables at a time, were I am sure, that no user is on the
> database.
Then that will work for you. But it's a bad general prescription
(which was my only point).
A
--
----
Andrew Sullivan 204-4141 Yonge Street
Liberty RMS Toronto, Ontario Canada
<andrew@libertyrms.info> M2P 2A8
+1 416 646 3304 x110
^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2003-05-06 19:54 UTC | newest]
Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-05-02 18:31 pg_dumpall / pg_dump jonesbl@WellsFargo.COM
2003-05-02 19:23 ` Daniel Seichter <daniel@dseichter.de>
2003-05-06 14:11 ` Andrew Sullivan <andrew@libertyrms.info>
2003-05-06 15:41 ` Daniel Seichter <daniel@dseichter.de>
2003-05-06 17:55 ` Daniel Seichter <daniel@dseichter.de>
2003-05-06 19:54 ` Andrew Sullivan <andrew@libertyrms.info>
2003-05-02 21:13 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox