Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 5857617B105F; Fri, 11 May 2012 16:40:02 -0300 (ADT) Received: from mail-pb0-f46.google.com ([209.85.160.46]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SSvh0-0005xj-FM; Fri, 11 May 2012 19:40:00 +0000 Received: by pbbrp8 with SMTP id rp8so3694425pbb.19 for ; Fri, 11 May 2012 12:39:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=yzdTWtL6fk0rpmojI9kCUSlUFzJmHVLnLZ6l+ol+KyY=; b=Hm6b2ixVCdORieaC2voWwfeYmMHNa/dWpO6vkU3Tssqg1FGtlbf9M906oJZPBfMKlT 7EbLjwiejQdE4/gesuJVl2Kw4KG238RB+7x3jIwagoAzvqC3YzFIZUMZ+hlivj5rI+X7 wE73pyNsjnPJDtdVKQble+OtBO/0R1EBkaFeXHZqiYTIP0hzbYeXCTNtzOV2/E0Heo+I mqzJOBFfaYdTojy+qSQBiCwJ1ae5qNAoD3h7neeBneLicXoq9Js0HmiRoIFq+0UtbceE d9E8xRfPAmjVagztf7T/p+qTfySzv2g7yBXQChUXvb4a1RrmihHW/EPHSAvxvucQm4/9 aC2g== Received: by 10.68.203.66 with SMTP id ko2mr9710853pbc.84.1336765183890; Fri, 11 May 2012 12:39:43 -0700 (PDT) Received: from [192.168.0.3] (c-24-17-164-54.hsd1.wa.comcast.net. [24.17.164.54]) by mx.google.com with ESMTPS id iu6sm13652932pbc.33.2012.05.11.12.39.42 (version=SSLv3 cipher=OTHER); Fri, 11 May 2012 12:39:43 -0700 (PDT) Message-ID: <4FAD6AE6.6000904@gmail.com> Date: Fri, 11 May 2012 12:39:18 -0700 From: Adrian Klaver User-Agent: Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Mitesh Shah CC: pgsql-admin@postgresql.org, pgsql-bugs@postgresql.org, pgsql-sql@postgresql.org, adelaide-au-pug@postgresql.org, seapug@postgresql.org Subject: Re: [SQL] pg_dump: aborting because of server version mismatch References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.7 (--) X-Archive-Number: 201205/2 X-Sequence-Number: 4 On 05/02/2012 12:55 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.shah@stripes39.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* The problem is you are using an older version of pg_dump to dump a newer database. That will not work. Possible solution: You are running via cron. Cron has its own environment. Unless you are explicit in your pathing you can get surprising results, see above. Find the path to the 9.1.2 version of pg_dump and use that absolute path in your script. > *pg_dump: aborting because of server version mismatch* > -e > All database backups complete! > -- Adrian Klaver adrian.klaver@gmail.com