pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
trigger run of archive_command?
5+ messages / 3 participants
[nested] [flat]

* trigger run of archive_command?
@ 2008-01-14 16:10  Sebastian Reitenbach <sebastia@l00-bugdead-prods.de>
  0 siblings, 1 reply; 5+ messages in thread

From: Sebastian Reitenbach @ 2008-01-14 16:10 UTC (permalink / raw)
  To: pgsql-admin

Hi,

I want to do online backup saving the WAL files. So I set the database into 
backup mode, make a backup, and then set the datbase to normal mode with 
pg_stop_backup(). 
To make the backup complete, I need to backup the actual WAL file too, but 
this one is still open when I run pg_stop_backup(), so I want to trigger the 
archive_command to be sure that I don't miss anything. 
In postgresql.conf I have defined an archive_command in postgresql.conf to 
tell postgres what to do when the WAL file reaches a maximum filesize. 

I use postgresql 8.1.4, so I only can make the archive_command depend on the 
size of the WAL files, right now the maximum size of a WAL file is defined 
to 16mb.
As a workaround I could create a dummy table, insert 16MB to make sure the 
WAL files get rotated, and then I can backup the last WAL file.

But my hope is that there is an easier way, e.g. do I can use a trigger to 
force the archive_command or any other mechanism?

kind regards
Sebastian




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: trigger run of archive_command?
@ 2008-01-14 16:19  Thomas Karcher <thkarcher@gmx.de>
  parent: Sebastian Reitenbach <sebastia@l00-bugdead-prods.de>
  0 siblings, 0 replies; 5+ messages in thread

From: Thomas Karcher @ 2008-01-14 16:19 UTC (permalink / raw)
  To: Sebastian Reitenbach <sebastia@l00-bugdead-prods.de>; +Cc: pgsql-admin

Hi,

> this one is still open when I run pg_stop_backup(), so I want to trigger the 
> archive_command to be sure that I don't miss anything. 

I guess what you want is pg_switch_xlog() (see
http://www.postgresql.org/docs/8.2/static/functions-admin.html)
which became available with PG 8.2 ...


Thomas

Attachments:

  signature.asc (application/pgp-signature, 188B) download

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: trigger run of archive_command?
@ 2008-01-14 16:39  Sebastian Reitenbach <sebastia@l00-bugdead-prods.de>
  0 siblings, 1 reply; 5+ messages in thread

From: Sebastian Reitenbach @ 2008-01-14 16:39 UTC (permalink / raw)
  To: ; +Cc: pgsql-admin

Hi,

Thomas Karcher <thkarcher@gmx.de> wrote: 
> Hi,
> 
> > this one is still open when I run pg_stop_backup(), so I want to trigger 
the 
> > archive_command to be sure that I don't miss anything. 
> 
> I guess what you want is pg_switch_xlog() (see
> http://www.postgresql.org/docs/8.2/static/functions-admin.html)
this is exactly what I am looking for
> which became available with PG 8.2 ...
unfortunately right now I am stuck to PG 8.1.4.
I hope I can manage to upgrade without too much hassle, it seems meanwhile I 
have to use my workaround.

thanks a lot
Sebastian




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: trigger run of archive_command?
@ 2008-01-16 10:21  Andreas 'ads' Scherbaum <adsmail@wars-nicht.de>
  parent: Sebastian Reitenbach <sebastia@l00-bugdead-prods.de>
  0 siblings, 0 replies; 5+ messages in thread

From: Andreas 'ads' Scherbaum @ 2008-01-16 10:21 UTC (permalink / raw)
  To: pgsql-admin; +Cc: Sebastian Reitenbach <sebastia@l00-bugdead-prods.de>


Hello,

On Mon, 14 Jan 2008 17:39:34 +0100 Sebastian Reitenbach wrote:

> Thomas Karcher <thkarcher@gmx.de> wrote: 
> > 
> > > this one is still open when I run pg_stop_backup(), so I want to trigger 
> > > the archive_command to be sure that I don't miss anything. 
> > 
> > I guess what you want is pg_switch_xlog() (see
> > http://www.postgresql.org/docs/8.2/static/functions-admin.html)
> this is exactly what I am looking for
> > which became available with PG 8.2 ...
> unfortunately right now I am stuck to PG 8.1.4.
> I hope I can manage to upgrade without too much hassle, it seems meanwhile I 
> have to use my workaround.

a very rude hack is to produce enough changes so that PG will rotate
the logfile anyway:

CHECKPOINT;
CREATE TABLE xlog_switch AS SELECT
'0123456789ABCDE'::VARCHAR FROM generate_series(1,300000);
DROP TABLE xlog_switch;

This is a lot of overhead, but it does the job.


Kind regards

-- 
				Andreas 'ads' Scherbaum
German PostgreSQL User Group



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: trigger run of archive_command?
@ 2008-01-16 12:00  Sebastian Reitenbach <sebastia@l00-bugdead-prods.de>
  0 siblings, 0 replies; 5+ messages in thread

From: Sebastian Reitenbach @ 2008-01-16 12:00 UTC (permalink / raw)
  To: pgsql-admin

Hi,
Andreas 'ads' Scherbaum <adsmail@wars-nicht.de> wrote: 
> 
> Hello,
> 
> On Mon, 14 Jan 2008 17:39:34 +0100 Sebastian Reitenbach wrote:
> 
> > Thomas Karcher <thkarcher@gmx.de> wrote: 
> > > 
> > > > this one is still open when I run pg_stop_backup(), so I want to 
trigger 
> > > > the archive_command to be sure that I don't miss anything. 
> > > 
> > > I guess what you want is pg_switch_xlog() (see
> > > http://www.postgresql.org/docs/8.2/static/functions-admin.html)
> > this is exactly what I am looking for
> > > which became available with PG 8.2 ...
> > unfortunately right now I am stuck to PG 8.1.4.
> > I hope I can manage to upgrade without too much hassle, it seems 
meanwhile I 
> > have to use my workaround.
> 
> a very rude hack is to produce enough changes so that PG will rotate
> the logfile anyway:
> 
> CHECKPOINT;
> CREATE TABLE xlog_switch AS SELECT
> '0123456789ABCDE'::VARCHAR FROM generate_series(1,300000);
> DROP TABLE xlog_switch;
> 
> This is a lot of overhead, but it does the job.
until we upgrade, we do it in a very similar way.

thanks
Sebastian





^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2008-01-16 12:00 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-01-14 16:10 trigger run of archive_command? Sebastian Reitenbach <sebastia@l00-bugdead-prods.de>
2008-01-14 16:19 ` Thomas Karcher <thkarcher@gmx.de>
2008-01-14 16:39 Re: trigger run of archive_command? Sebastian Reitenbach <sebastia@l00-bugdead-prods.de>
2008-01-16 10:21 ` Andreas 'ads' Scherbaum <adsmail@wars-nicht.de>
2008-01-16 12:00 Re: trigger run of archive_command? Sebastian Reitenbach <sebastia@l00-bugdead-prods.de>

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