X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 531BED1B2E6 for ; Sun, 27 Jun 2004 19:13:55 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 24928-02 for ; Sun, 27 Jun 2004 22:13:56 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id D3ED7D1B2E0 for ; Sun, 27 Jun 2004 19:13:53 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i5RMCbsE014321; Sun, 27 Jun 2004 18:12:37 -0400 (EDT) To: reina_ga@hotmail.com (Tony Reina) Cc: pgsql-admin@postgresql.org Subject: Re: Password with libpq In-reply-to: <272e4be7.0406270913.7a65f99f@posting.google.com> References: <272e4be7.0406270913.7a65f99f@posting.google.com> Comments: In-reply-to reina_ga@hotmail.com (Tony Reina) message dated "27 Jun 2004 10:13:54 -0700" Date: Sun, 27 Jun 2004 18:12:37 -0400 Message-ID: <14320.1088374357@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200406/348 X-Sequence-Number: 14008 reina_ga@hotmail.com (Tony Reina) writes: > However, what about in the general case where my client program > doesn't know if a password is required or not. Is there any libpq > function to query the server if a password is required? Perhaps, > there's a return value for PQconnectdb which would tell me that the > connection failed because of the password? (In which case, I can ask > for the password and try the connection again.) Look into the psql source code; it does essentially this. regards, tom lane