Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eFofh-0004pR-3s for pgsql-general@arkaria.postgresql.org; Fri, 17 Nov 2017 21:59:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1eFofg-0006dn-N0 for pgsql-general@arkaria.postgresql.org; Fri, 17 Nov 2017 21:59:36 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eFod7-00018k-GJ for pgsql-general@postgresql.org; Fri, 17 Nov 2017 21:56:57 +0000 Received: from mail-qk0-x229.google.com ([2607:f8b0:400d:c09::229]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eFod0-0006jQ-2q for pgsql-general@postgresql.org; Fri, 17 Nov 2017 21:56:56 +0000 Received: by mail-qk0-x229.google.com with SMTP id b85so1137343qkc.13 for ; Fri, 17 Nov 2017 13:56:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=G3gydOQiEtN5S54ZImxbBiYndAIDMQl2Wu7BYpIXowc=; b=rWOPoPNsfy6dwycxD6tXPnV7VD1+pxb+zgFFLgWukZzRj6G1jfhJjtBXf08RzPNocw +sr/g2/G9W+hkMrMDfNZyMqV54KVMLUnW+4dCn09w6jcwM0Dwnu+TYKxgd23Rkx2dgeB v7vkKB3xo1mUUgMNo2Vg7Q7Aag4I3P9uEGRauvckzBPTIIB75mbX5tnK+OHIfxRZBO0a 1EOgsic5+PTAOq9Os2woWVgOC739oIhuHxQyZDx5CprP/ly9wk8ExXiH3OmyonYgmq/x 3HdkTflP6VrZpzdGpZtFw+SmAVsrgroIc2iNGuO9qHfvOmVtzJigSAzOKensCb1aE3bQ jP2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=G3gydOQiEtN5S54ZImxbBiYndAIDMQl2Wu7BYpIXowc=; b=WZsoI9u9Xpnyrv15nsn1HZynEhHkDO2VjcTlNs8dHo+KNy8Qg2kFFugSnoUX+yYYcT jHVArlqd0As3M4eaJrugO2DpuLdgn534/10dAXixPNVMhxEnSHXayXqWkVK+rG5k6WXu vn1JzOArazMnHdyEEHS89Lx7mzR/TLcWsPKr9hupA2D+rs6KnfAMOzzu91eaig+lygZi UrTqJS4mOQfNyyiF65iEnbRzcfVM9pGxswkIFpOrGfVvJxnofwM76tsFZBlie9ZkGu/0 WNc8WVOOiR+UPHfR8HpGxkiftn8z55EJtjGRc6qwTRGzlNHgl74KBdbRn+Qikq9Is1Qg ApcA== X-Gm-Message-State: AJaThX5Vpdx7yo9X/JUA8wXj4RN4fxawaQwaJv3xyZY9iJxhYaTB0qnw 9D7tAVE/obhtGjOcC3dZPexFWbsW X-Google-Smtp-Source: AGs4zMZe3XvzrIQ0MzSgd/SvasJ1vUZvuoOxLaJUbO18b946WQ4FDcvKymOaH/bd8TGXvo6bmgl0BQ== X-Received: by 10.55.108.68 with SMTP id h65mr10660930qkc.13.1510955808546; Fri, 17 Nov 2017 13:56:48 -0800 (PST) Received: from [192.168.1.240] (host145.190-229-78.telecom.net.ar. [190.229.78.145]) by smtp.gmail.com with ESMTPSA id 2sm3325005qto.28.2017.11.17.13.56.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Nov 2017 13:56:48 -0800 (PST) Subject: Re: mild modification to pg_dump To: Scott Mead Cc: PostgreSQL General References: <83ed30b6-a397-9072-67e5-0bde83ce28b7@gmail.com> <023dc0d6-8fa3-7217-cf5c-0e3131c3b8c2@gmail.com> <214e4cff-f625-1bb1-4e26-942b07877bcc@gmail.com> From: marcelo Message-ID: Date: Fri, 17 Nov 2017 18:56:45 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------637F4A0A87165AE183A0C793" Content-Language: en-US List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org This is a multi-part message in MIME format. --------------637F4A0A87165AE183A0C793 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Thank you, Scott. That's happening me because incomplete docs reading. Truly, I'm catched in a very big app, so I have no time to read all the docs. On 17/11/17 18:31, Scott Mead wrote: > > On Fri, Nov 17, 2017 at 4:06 PM, marcelo > wrote: > > I need to "emulate" the pg_dump code because the password prompt. > Years ago I write a program (for the QnX environment) that catched > some prompt and emulates the standard input. I don't like to do > that again. > > > pg_dump can use an environment variable "PGPASSWORD" upon execution > (actually, all libpq programs can).  You could have a wrapper that > sets the environment variable and then executes pg_dump, this would > get you around that prompt.  Similarly, you could use the .pgpass file. > > https://www.postgresql.org/docs/9.5/static/libpq-envars.html > https://www.postgresql.org/docs/9.5/static/libpq-pgpass.html > > --Scott > > > > On 17/11/17 17:23, John R Pierce wrote: > > On 11/17/2017 12:19 PM, marcelo wrote: > > Sorry, I was not exact. > I don't need nor like to change pg_dump. Rather, based on > pg_dump code, I need to develop a daemon which can receive > a TCP message (from a privileged app) containing some > elements: the database to dump, the user under which do > that, and his password. (My apps are using that same data, > of course, encripted to the common users). > > > > I would just fork pg_dump to do the actual dump rather than > try and incorporate its source code into your app. > > > > > > -- > Sent via pgsql-general mailing list (pgsql-general@postgresql.org > ) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-general > > > > > > -- > -- > Scott Mead > Sr. Architect > /OpenSCG / > http://openscg.com --------------637F4A0A87165AE183A0C793 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit Thank you, Scott.
That's happening me because incomplete docs reading.
Truly, I'm catched in a very big app, so I have no time to read all the docs.


On 17/11/17 18:31, Scott Mead wrote:

On Fri, Nov 17, 2017 at 4:06 PM, marcelo <marcelo.nicolet@gmail.com> wrote:
I need to "emulate" the pg_dump code because the password prompt. Years ago I write a program (for the QnX environment) that catched some prompt and emulates the standard input. I don't like to do that again.

pg_dump can use an environment variable "PGPASSWORD" upon execution (actually, all libpq programs can).  You could have a wrapper that sets the environment variable and then executes pg_dump, this would get you around that prompt.  Similarly, you could use the .pgpass file.


--Scott

 


On 17/11/17 17:23, John R Pierce wrote:
On 11/17/2017 12:19 PM, marcelo wrote:
Sorry, I was not exact.
I don't need nor like to change pg_dump. Rather, based on pg_dump code, I need to develop a daemon which can receive a TCP message (from a privileged app) containing some elements: the database to dump, the user under which do that, and his password. (My apps are using that same data, of course, encripted to the common users).


I would just fork pg_dump to do the actual dump rather than try and incorporate its source code into your app.





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



--
--
Scott Mead
Sr. Architect
OpenSCG

--------------637F4A0A87165AE183A0C793--