Skip site navigation (1) Skip section navigation (2)

Re: [sfpug] pg_dump: aborting because of server version mismatch

From: Christophe Pettus <xof(at)thebuild(dot)com>
To: Mitesh Shah <mitesh(dot)shah(at)stripes39(dot)com>
Cc: sfpug(at)postgresql(dot)org, atlpug(at)postgresql(dot)org, austinpug(at)postgresql(dot)org, bostonpug(at)postgresql(dot)org, bwpug(at)postgresql(dot)org
Subject: Re: [sfpug] pg_dump: aborting because of server version mismatch
Date: 2012-05-03 03:27:28
Message-ID: 7DDB8E70-7E48-4EA5-8D54-A4E754971830@thebuild.com (view raw or flat)
Thread:
Lists: adelaide-au-pugatlpugaustinpugbostonpugbwpugpgsql-adminpgsql-bugspgsql-sqlseapugsfpug
Hi, Mitesh,

The error means exactly what it says: You're trying to use the 9.0.5 version of pg_dump to dump a server running 9.1.2; you need a version of pg_dump that is no older than the server you are trying to do the dump from.

On May 2, 2012, at 12:58 PM, Mitesh Shah wrote:

> Hi,
> I am trying to create a daily backup cron script but it fails with an error as below:
> 
> Any pointers to resolve this will be greatly appreciated.
> 
> Thanks,
> Mitesh Shah
> mitesh(dot)shah(at)stripes39(dot)com
> 
> (1) Error:
> bash-3.2$ sh pg_backup_rotated_orig.sh 
> Making backup directory in /Users/miteshshah/Documents/2012-05-02-daily/
> -e 
> 
> Performing full backups
> -e --------------------------------------------
> 
> Plain backup of mitesh
> pg_dump: server version: 9.1.2; pg_dump version: 9.0.5
> pg_dump: aborting because of server version mismatch
> -e 
> All database backups complete!
> 
> 
> 
> (2.1)    /Users/miteshshah/Desktop/pg_backup.config file:
> #############################
> ## POSTGRESQL BACKUP CONFIG ##
> ##############################
> # hostname to adhere to pg_hba policies.
> HOSTNAME= <host>
> 
> # username to connect to database as.
> USERNAME=<user>
> 
> # Database name
> DATABASE=<database>
> 
> # This dir will be created if it doesn't exist.  This must be writable by the user the script is
> # running as.
> BACKUP_DIR=<backup_dir>
> 
> # SCRIPTPATH
> SCRIPTPATH=<path>
> 
> # Will produce a custom-format backup if set to "yes"
> ENABLE_CUSTOM_BACKUPS=yes
> 
> # Will produce a gzipped plain-format backup if set to "yes"
> ENABLE_PLAIN_BACKUPS=yes
> 
> 
> #### SETTINGS FOR ROTATED BACKUPS ####
> 
> # Which day to take the weekly backup from (1-7 = Monday-Sunday)
> DAY_OF_WEEK_TO_KEEP=5
> 
> # Number of days to keep daily backups
> DAYS_TO_KEEP=7
> 
> # How many weeks to keep weekly backups
> WEEKS_TO_KEEP=5
> 
> ######################################
> 
> 
> (2.2)  /Users/miteshshah/Desktop/pg_backup_rotated_orig.sh
> #!/bin/bash
> 
> ###########################
> ####### LOAD CONFIG #######
> ###########################
> 
> source /Users/miteshshah/Desktop/pg_backup.config
> 
> 
> ###########################
> #### START THE BACKUPS ####
> ###########################
> 
> function perform_backups()
> {
>         SUFFIX=$1
>         FINAL_BACKUP_DIR=$BACKUP_DIR"`date +\%Y-\%m-\%d`$SUFFIX/"
> 
>         echo "Making backup directory in $FINAL_BACKUP_DIR"
> 
>         if ! mkdir -p $FINAL_BACKUP_DIR; then
>                 echo "Cannot create backup directory in $FINAL_BACKUP_DIR. Go and fix it!"
>                 exit 1;
>         fi;
> 
> 
>         ###########################
>         ###### FULL BACKUPS #######
>         ###########################
> 
>         echo -e "\n\nPerforming full backups"
>         echo -e "--------------------------------------------\n"
> 
> 
> 
>                 if [ $ENABLE_PLAIN_BACKUPS = "yes" ]
>                 then
>                         echo "Plain backup of $DATABASE"
> 
>                         if ! pg_dump -Fp -h "$HOSTNAME" -U "$USERNAME" "$DATABASE" | gzip > $FINAL_BACKUP_DIR"$DATABASE".sql.gz.in_progress; then
>                                 echo "[!!ERROR!!] Failed to produce plain backup database $DATABASE"
>                         else
>                                 mv $FINAL_BACKUP_DIR"$DATABASE".sql.gz.in_progress $FINAL_BACKUP_DIR"$DATABASE".sql.gz
>                         fi
>                 fi
> 
>                 if [ $ENABLE_CUSTOM_BACKUPS = "yes" ]
>                 then
>                         echo "Custom backup of $DATABASE"
> 
>                         if ! pg_dump -Fc -h "$HOSTNAME" -U "$USERNAME" "$DATABASE" -f $FINAL_BACKUP_DIR"$DATABASE".custom.in_progress; then
>                                 echo "[!!ERROR!!] Failed to produce custom backup database $DATABASE"
>                         else
>                                 mv $FINAL_BACKUP_DIR"$DATABASE".custom.in_progress $FINAL_BACKUP_DIR"$DATABASE".custom
>                         fi
>                 fi
> 
> 
> 
>         echo -e "\nAll database backups complete!"
> }
> 
> # DAILY BACKUPS
> 
> # Delete daily backups 7 days old or more
> find $BACKUP_DIR -maxdepth 1 -mtime +$DAYS_TO_KEEP -name "*-daily" -exec rm -rf '{}' ';'
> 
> 

--
-- Christophe Pettus
   xof(at)thebuild(dot)com


In response to

austinpug by date

Next:From: Adrian KlaverDate: 2012-05-11 19:39:18
Subject: Re: [SQL] pg_dump: aborting because of server version mismatch
Previous:From: Robert BernierDate: 2012-05-02 22:27:49
Subject: Re: [seapug] Re: [BUGS] pg_dump: aborting because of server version mismatchT

adelaide-au-pug by date

Next:From: Adrian KlaverDate: 2012-05-11 19:39:18
Subject: Re: [SQL] pg_dump: aborting because of server version mismatch
Previous:From: Robert BernierDate: 2012-05-02 22:27:49
Subject: Re: [seapug] Re: [BUGS] pg_dump: aborting because of server version mismatchT

bostonpug by date

Next:From: Adrian KlaverDate: 2012-05-11 19:39:18
Subject: Re: [SQL] pg_dump: aborting because of server version mismatch
Previous:From: Robert BernierDate: 2012-05-02 22:27:49
Subject: Re: [seapug] Re: [BUGS] pg_dump: aborting because of server version mismatchT

seapug by date

Next:From: kah42pubDate: 2012-05-10 00:45:18
Subject: PgMag
Previous:From: Robert BernierDate: 2012-05-02 22:48:25
Subject: Re: Re: [BUGS] pg_dump: aborting because of server version mismatchT

pgsql-admin by date

Next:From: sgmDate: 2012-05-03 05:47:52
Subject: postgresql stream replication question
Previous:From: Robert BernierDate: 2012-05-02 22:27:49
Subject: Re: [seapug] Re: [BUGS] pg_dump: aborting because of server version mismatchT

pgsql-bugs by date

Next:From: Tom LaneDate: 2012-05-03 04:26:59
Subject: Re: select table indicate missing chunk number 0 for toast value 96635 in pg_toast_2619
Previous:From: leo xuDate: 2012-05-03 03:25:51
Subject: select table indicate missing chunk number 0 for toast value 96635 in pg_toast_2619

sfpug by date

Next:From: Josh BerkusDate: 2012-05-04 16:23:23
Subject: Re: SFPUG parking for Amazonstravaganza?
Previous:From: Robert BernierDate: 2012-05-02 22:27:49
Subject: Re: [seapug] Re: [BUGS] pg_dump: aborting because of server version mismatchT

bwpug by date

Next:From: Adrian KlaverDate: 2012-05-11 19:39:18
Subject: Re: [SQL] pg_dump: aborting because of server version mismatch
Previous:From: Robert BernierDate: 2012-05-02 22:27:49
Subject: Re: [seapug] Re: [BUGS] pg_dump: aborting because of server version mismatchT

atlpug by date

Next:From: Adrian KlaverDate: 2012-05-11 19:39:18
Subject: Re: [SQL] pg_dump: aborting because of server version mismatch
Previous:From: Robert BernierDate: 2012-05-02 22:27:49
Subject: Re: [seapug] Re: [BUGS] pg_dump: aborting because of server version mismatchT

pgsql-sql by date

Next:From: Marcel RuffDate: 2012-05-04 10:25:45
Subject: How change col name during query to use it in where clause
Previous:From: Robert BernierDate: 2012-05-02 22:27:49
Subject: Re: [seapug] Re: [BUGS] pg_dump: aborting because of server version mismatchT

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group