Search Postgresql Archives

Re: Re-sync slave server

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/08/2016 01:47 PM, Patrick B wrote:


2016-06-08 11:03 GMT+12:00 Adrian Klaver <adrian.klaver@xxxxxxxxxxx
<mailto:adrian.klaver@xxxxxxxxxxx>>:

    On 06/07/2016 03:22 PM, Patrick B wrote:

        One more question guys...

        Does the pg_basebackup re-write the data? or do I have to have
        free space?

        Like.. the DB is 2 TB.. do I have to have more 2TB? or it will
        use those
        2TB that already are there?


    I would suggest taking a tour of:

    https://www.postgresql.org/docs/9.2/static/app-pgbasebackup.html


It does not say anything about that.. if it will use more space or if it
will replace the current data and the disk space will be the same

https://www.postgresql.org/docs/9.2/static/app-pgbasebackup.html
"
-D directory
--pgdata=directory

Directory to write the output to. pg_basebackup will create the directory and any parent directories if necessary. The directory may already exist, but it is an error if the directory already exists and is not empty.

When the backup is in tar mode, and the directory is specified as - (dash), the tar file will be written to stdout.

    This option is required.
"

So no it will not replace existing data. You will need to start with an empty $DATADIR. If you do not want to duplicate the space empty the existing $DATADIR. If you want to be double safe run the backup to another directory and then copy it over later.




--
Adrian Klaver
adrian.klaver@xxxxxxxxxxx


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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux