pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedPostgres 8.0 Backups
6+ messages / 4 participants
[nested] [flat]
* Postgres 8.0 Backups
@ 2005-01-24 16:47 Pallav Kalva <pkalva@deg.cc>
0 siblings, 1 reply; 6+ messages in thread
From: Pallav Kalva @ 2005-01-24 16:47 UTC (permalink / raw)
To: pgsql-admin
Hi Everybody,
I am working on a backup script for Postgres 8.0 online backups and
since i have to copy the whole pgdata directory , i am wondering after i
copy the pgdata directory can I run gzip or tar on the data directory ?
is it safe to do gzip or tar and I can safely restore the backups later ?
Thanks in advance,
Pallav
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Postgres 8.0 Backups
@ 2005-01-24 17:09 Scott Marlowe <smarlowe@g2switchworks.com>
parent: Pallav Kalva <pkalva@deg.cc>
0 siblings, 1 reply; 6+ messages in thread
From: Scott Marlowe @ 2005-01-24 17:09 UTC (permalink / raw)
To: Pallav Kalva <pkalva@deg.cc>; +Cc: pgsql-admin
On Mon, 2005-01-24 at 10:47, Pallav Kalva wrote:
> Hi Everybody,
>
> I am working on a backup script for Postgres 8.0 online backups and
> since i have to copy the whole pgdata directory , i am wondering after i
> copy the pgdata directory can I run gzip or tar on the data directory ?
> is it safe to do gzip or tar and I can safely restore the backups later ?
Yes, however, you may have some issues to deal with.
Generally speaking, file system level backups are not the best way to
backup postgresql, since they require either shutting down the server or
using a snapshot file system to get a coherent backup. File system
backups taken by normal copy / tar during database operation may result
in backups that don't work when you need them to.
pg_dump is generally the better way to back things up, and with the
right switches will create a Z compressed tar file automagically for
you.
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Postgres 8.0 Backups
@ 2005-01-24 18:05 Tom Lane <tgl@sss.pgh.pa.us>
parent: Scott Marlowe <smarlowe@g2switchworks.com>
0 siblings, 1 reply; 6+ messages in thread
From: Tom Lane @ 2005-01-24 18:05 UTC (permalink / raw)
To: Scott Marlowe <smarlowe@g2switchworks.com>; +Cc: Pallav Kalva <pkalva@deg.cc>; pgsql-admin
Scott Marlowe <smarlowe@g2switchworks.com> writes:
> On Mon, 2005-01-24 at 10:47, Pallav Kalva wrote:
>> I am working on a backup script for Postgres 8.0 online backups and
>> since i have to copy the whole pgdata directory , i am wondering after i
>> copy the pgdata directory can I run gzip or tar on the data directory ?
> Generally speaking, file system level backups are not the best way to
> backup postgresql, since they require either shutting down the server or
> using a snapshot file system to get a coherent backup.
In the context of online backup operations, that advice isn't relevant
anymore ...
Personally I would do "tar cfz pgdata.tar.gz $PGDATA" or equivalent,
rather than making an explicit copy of the directory tree first.
regards, tom lane
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Postgres 8.0 Backups
@ 2005-01-24 18:27 Scott Marlowe <smarlowe@g2switchworks.com>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 6+ messages in thread
From: Scott Marlowe @ 2005-01-24 18:27 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Pallav Kalva <pkalva@deg.cc>; pgsql-admin
On Mon, 2005-01-24 at 12:05, Tom Lane wrote:
> Scott Marlowe <smarlowe@g2switchworks.com> writes:
> > On Mon, 2005-01-24 at 10:47, Pallav Kalva wrote:
> >> I am working on a backup script for Postgres 8.0 online backups and
> >> since i have to copy the whole pgdata directory , i am wondering after i
> >> copy the pgdata directory can I run gzip or tar on the data directory ?
>
> > Generally speaking, file system level backups are not the best way to
> > backup postgresql, since they require either shutting down the server or
> > using a snapshot file system to get a coherent backup.
>
> In the context of online backup operations, that advice isn't relevant
> anymore ...
Really, is this an 8.0 thing then, that I can make file system backups
and expect them to be coherent, or did I misunderhear what you meant and
this has to do with some other issue I'm not getting?
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Postgres 8.0 Backups
@ 2005-01-24 18:30 Tom Lane <tgl@sss.pgh.pa.us>
parent: Scott Marlowe <smarlowe@g2switchworks.com>
0 siblings, 1 reply; 6+ messages in thread
From: Tom Lane @ 2005-01-24 18:30 UTC (permalink / raw)
To: Scott Marlowe <smarlowe@g2switchworks.com>; +Cc: Pallav Kalva <pkalva@deg.cc>; pgsql-admin
Scott Marlowe <smarlowe@g2switchworks.com> writes:
> On Mon, 2005-01-24 at 12:05, Tom Lane wrote:
>> In the context of online backup operations, that advice isn't relevant
>> anymore ...
> Really, is this an 8.0 thing then, that I can make file system backups
> and expect them to be coherent, or did I misunderhear what you meant and
> this has to do with some other issue I'm not getting?
No, it means that when doing PITR stuff you don't actually care that
your base backup isn't consistent --- you expect WAL replay to fix it.
See http://www.postgresql.org/docs/8.0/static/backup-online.html
regards, tom lane
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Postgres 8.0 Backups
@ 2005-02-01 04:20 Bruce Momjian <pgman@candle.pha.pa.us>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 6+ messages in thread
From: Bruce Momjian @ 2005-02-01 04:20 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Scott Marlowe <smarlowe@g2switchworks.com>; Pallav Kalva <pkalva@deg.cc>; pgsql-admin
Tom Lane wrote:
> Scott Marlowe <smarlowe@g2switchworks.com> writes:
> > On Mon, 2005-01-24 at 12:05, Tom Lane wrote:
> >> In the context of online backup operations, that advice isn't relevant
> >> anymore ...
>
> > Really, is this an 8.0 thing then, that I can make file system backups
> > and expect them to be coherent, or did I misunderhear what you meant and
> > this has to do with some other issue I'm not getting?
>
> No, it means that when doing PITR stuff you don't actually care that
> your base backup isn't consistent --- you expect WAL replay to fix it.
> See http://www.postgresql.org/docs/8.0/static/backup-online.html
Right, the big issue is that you have to be archiving the WAL logs
before you do the filesystem backup, and the WAL files will restore the
recovery to a consistent state.
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2005-02-01 04:20 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-01-24 16:47 Postgres 8.0 Backups Pallav Kalva <pkalva@deg.cc>
2005-01-24 17:09 ` Scott Marlowe <smarlowe@g2switchworks.com>
2005-01-24 18:05 ` Tom Lane <tgl@sss.pgh.pa.us>
2005-01-24 18:27 ` Scott Marlowe <smarlowe@g2switchworks.com>
2005-01-24 18:30 ` Tom Lane <tgl@sss.pgh.pa.us>
2005-02-01 04:20 ` Bruce Momjian <pgman@candle.pha.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