From bc@vio.ro Wed Jul 16 13:41:56 2003 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.192]) by svr1.postgresql.org (Postfix) with ESMTP id 147A3CC456 for ; Wed, 16 Jul 2003 13:41:56 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr4.postgresql.org [64.117.224.192]) (amavisd-new, port 10024) with ESMTP id 99923-09 for ; Wed, 16 Jul 2003 13:42:14 +0000 (GMT) Received: from mail1.dr.myx.net (mail1.dr.myx.net [217.10.193.161]) by svr1.postgresql.org (Postfix) with ESMTP id B4D41CBF0C for ; Wed, 16 Jul 2003 10:41:51 -0300 (ADT) Received: from workstation24 (unknown [81.12.137.146]) by mail1.dr.myx.net (mydomain.myx.net) with ESMTP id 53D02300681 for ; Wed, 16 Jul 2003 16:42:07 +0300 (EEST) Message-ID: <004501c34b9f$f7d8f520$0600a8c0@fix.ro> From: "Viorel Dragomir" To: Subject: pg_dump "feature" Date: Wed, 16 Jul 2003 16:41:31 +0300 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0042_01C34BB9.1CAF0150" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.7 tagged_above=0.0 required=5.0 tests=HTML_40_50 X-Spam-Level: X-Archive-Number: 200307/195 X-Sequence-Number: 14309 This is a multi-part message in MIME format. ------=_NextPart_000_0042_01C34BB9.1CAF0150 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable In 7.1.2 you can launch this command without any problems: pg_dump -u -s database < file.txt where file.txt contains 2 lines: username password ~ ~ ~ And you'll get the dump of the . In 7.1.3 this command work, the only incovenience is that pg_dump shows "Us= er name: Password:"=20 but gets the password from file. In 7.3.x the pg_dump accepts the password only from stdin. The user must en= ter his password. It's a feature or a bug, because i can't see any logic in this behaviour. I hope i'll receive an answer, or else i'll post this topic on developers l= ist :) Thanks. ------=_NextPart_000_0042_01C34BB9.1CAF0150 Content-Type: text/html; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable
In 7.1.2 you can launch this command witho= ut any=20 problems:
pg_dump -u -s database <=20 file.txt
 
where file.txt contains 2 lines:
username
password
~
~
~
 
And you'll get the dump of the=20 <database>.
 
In 7.1.3 this command work, the only incov= enience=20 is that pg_dump shows "User name: Password:"
but gets the password from file.
 
In 7.3.x the pg_dump accepts the password = only from=20 stdin. The user must enter his password.
It's a feature or a bug, because i can't s= ee any=20 logic in this behaviour.
 
I hope i'll receive an answer, or else i'l= l post=20 this topic on developers list :)
 
Thanks.
------=_NextPart_000_0042_01C34BB9.1CAF0150-- From tgl@sss.pgh.pa.us Wed Jul 16 14:29:16 2003 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.225.181]) by svr1.postgresql.org (Postfix) with ESMTP id 02FDFCC667 for ; Wed, 16 Jul 2003 14:29:16 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr5.postgresql.org [64.117.225.181]) (amavisd-new, port 10024) with ESMTP id 39682-02 for ; Wed, 16 Jul 2003 14:29:27 +0000 (GMT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 53D78CC657 for ; Wed, 16 Jul 2003 11:29:04 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h6GETVQ3018026; Wed, 16 Jul 2003 10:29:31 -0400 (EDT) To: "Viorel Dragomir" Cc: pgsql-sql@postgresql.org Subject: Re: pg_dump "feature" In-reply-to: <004501c34b9f$f7d8f520$0600a8c0@fix.ro> References: <004501c34b9f$f7d8f520$0600a8c0@fix.ro> Comments: In-reply-to "Viorel Dragomir" message dated "Wed, 16 Jul 2003 16:41:31 +0300" Date: Wed, 16 Jul 2003 10:29:30 -0400 Message-ID: <18025.1058365770@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/199 X-Sequence-Number: 14313 "Viorel Dragomir" writes: > In 7.3.x the pg_dump accepts the password only from stdin. The user must en= > ter his password. > It's a feature or a bug, because i can't see any logic in this behaviour. It's a feature ... or at least an intentional change. If you want to keep your password in a file, see the ~/.pgpass feature. regards, tom lane From dmitry@openratings.com Wed Jul 16 14:33:07 2003 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.225.181]) by svr1.postgresql.org (Postfix) with ESMTP id AD944CC62E for ; Wed, 16 Jul 2003 14:33:07 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr5.postgresql.org [64.117.225.181]) (amavisd-new, port 10024) with ESMTP id 40398-01 for ; Wed, 16 Jul 2003 14:33:16 +0000 (GMT) Received: from exchange.hq.openratings.com (unknown [141.149.165.226]) by svr1.postgresql.org (Postfix) with ESMTP id 3D1BECC64F for ; Wed, 16 Jul 2003 11:32:53 -0300 (ADT) Received: from openratings.com (cancun.hq.openratings.com [10.0.0.225]) by exchange.hq.openratings.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id 38QM4LQV; Wed, 16 Jul 2003 10:33:20 -0400 Message-ID: <3F156253.3080104@openratings.com> Date: Wed, 16 Jul 2003 10:33:55 -0400 From: Dmitry Tkach User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021130 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Viorel Dragomir Cc: pgsql-sql@postgresql.org Subject: Re: pg_dump "feature" References: <004501c34b9f$f7d8f520$0600a8c0@fix.ro> In-Reply-To: <004501c34b9f$f7d8f520$0600a8c0@fix.ro> Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/201 X-Sequence-Number: 14315 Viorel Dragomir wrote: > In 7.1.2 you can launch this command without any problems: > pg_dump -u -s database < file.txt > > where file.txt contains 2 lines: > username > password > ~ > ~ > ~ > > And you'll get the dump of the . > > In 7.1.3 this command work, the only incovenience is that pg_dump > shows "User name: Password:" > but gets the password from file. > > In 7.3.x the pg_dump accepts the password only from stdin. The user > must enter his password. > It's a feature or a bug, because i can't see any logic in this behaviour. It's a feature :-) The logic is that it is insecure to keep passwords in files. If you are not concerned about the security in this case, you can switch to ident or trust identification. That won't prompt you for the password. Dima. From bc@vio.ro Wed Jul 16 14:44:27 2003 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.225.181]) by svr1.postgresql.org (Postfix) with ESMTP id 62B59CC58C for ; Wed, 16 Jul 2003 14:44:27 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr5.postgresql.org [64.117.225.181]) (amavisd-new, port 10024) with ESMTP id 39923-04 for ; Wed, 16 Jul 2003 14:44:38 +0000 (GMT) Received: from mail1.dr.myx.net (mail1.dr.myx.net [217.10.193.161]) by svr1.postgresql.org (Postfix) with ESMTP id 267DBCC678 for ; Wed, 16 Jul 2003 11:44:15 -0300 (ADT) Received: from workstation24 (unknown [81.12.137.146]) by mail1.dr.myx.net (mydomain.myx.net) with ESMTP id A6287300681 for ; Wed, 16 Jul 2003 17:44:29 +0300 (EEST) Message-ID: <00be01c34ba8$aec682e0$0600a8c0@fix.ro> From: "Viorel Dragomir" To: References: <004501c34b9f$f7d8f520$0600a8c0@fix.ro> <18025.1058365770@sss.pgh.pa.us> Subject: Re: pg_dump "feature" Date: Wed, 16 Jul 2003 17:43:54 +0300 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/203 X-Sequence-Number: 14317 Thanks for the answer[s]. Interesting that when i launch the command from php through exec() it works fine even on pg_dump 7.3.x I guess this feature works only on [shell] command line. This is the php code: $tmp_fname = tempnam("/tmp", "file-"); $f = fopen($tmp_fname, "w"); fwrite($f, "$username\n".USER_DB_PASSWORD."\n"); fclose($f); $cmd = "pg_dump $add_cmd $export $add_table < $tmp_fname"; $result = system($cmd); unlink($tmp_fname); ----- Original Message ----- From: "Tom Lane" To: "Viorel Dragomir" Cc: Sent: Wednesday, July 16, 2003 5:29 PM Subject: Re: [SQL] pg_dump "feature" > "Viorel Dragomir" writes: > > In 7.3.x the pg_dump accepts the password only from stdin. The user must en= > > ter his password. > > It's a feature or a bug, because i can't see any logic in this behaviour. > > It's a feature ... or at least an intentional change. > > If you want to keep your password in a file, see the ~/.pgpass feature. > > regards, tom lane > > ---------------------------(end of broadcast)--------------------------- > TIP 9: the planner will ignore your desire to choose an index scan if your > joining column's datatypes do not match