Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wwc24-0005k3-PL for pgsql-admin@arkaria.postgresql.org; Mon, 16 Jun 2014 18:53:28 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Wwc24-0006xP-9N for pgsql-admin@arkaria.postgresql.org; Mon, 16 Jun 2014 18:53:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Wwc23-0006xH-Jm for pgsql-admin@postgresql.org; Mon, 16 Jun 2014 18:53:27 +0000 Received: from mail-yk0-x22b.google.com ([2607:f8b0:4002:c07::22b]) by magus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1Wwc20-0002Mp-MO for pgsql-admin@postgresql.org; Mon, 16 Jun 2014 18:53:26 +0000 Received: by mail-yk0-f171.google.com with SMTP id 200so4464964ykr.2 for ; Mon, 16 Jun 2014 11:53:22 -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:subject :content-type:content-transfer-encoding; bh=3uMeXTRgTDQ3nkPOfssQmwPkzd3HsmDVIDL3TI51E7U=; b=HR1zJOBzUnZXHxefJfrejxrl06cYmPhsM9d/hzXZRiyFrL/1Tkvbc3GvxNMFgocJqs u9jvpU0o0hWCLCr8uQPSX+vF5h8zmcp7N913B1p+t9tdY3OAAAr8tFFYckdfopt9NyU8 D1pji6JN+uavWPLV/VDSsvFgM6JI7Jg8fDSHEa4mF28Iqbs4XuKJsHIzN3zUs1UyaxuK wNZbyVVQrAeF5R6idqawq1XANMvX01jinlQyN5iLjtoliwMynT+x1mc+VRLgj2gqOYlk 192wIP7MDrNH1tShSCTucF7P78KaepAEPC4YDzptN48TPStqzjs3TRYp13FGyLVVgATg +/0A== X-Received: by 10.236.45.10 with SMTP id o10mr36544173yhb.49.1402944802398; Mon, 16 Jun 2014 11:53:22 -0700 (PDT) Received: from [192.168.254.4] (h77.89.102.166.static.ip.windstream.net. [166.102.89.77]) by mx.google.com with ESMTPSA id u22sm22005106yhm.17.2014.06.16.11.53.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Jun 2014 11:53:22 -0700 (PDT) Message-ID: <539F3D20.1060001@gmail.com> Date: Mon, 16 Jun 2014 14:53:20 -0400 From: John Scalia User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Using psql, pg_dump, pg_restore in a script Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org Hi all, My latest task requires me to script extracting the latest data from a partitioned table and put it into another database on a different machine on an hourly basis. To do this, the script uses a psql command to determine which partition to grab, a pg_dump to get it, and pg_restore to put into the other Db. My issue is that I'd like to make this script very portable but it seems that whenever you pass a "-h -U " to these commands, they will ask for a password whether "someuser" actually has a password or not. I've currently set a password for the user the script uses and I'm using .pgpass to make this work, but was there some reason that an option was not given to enter a password as an argument to the command? Maybe something like --password ? I know this could potentially be a security problem, but so is having a password in the .pgpass file in clear text. -- Jay -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin