X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 45D708B9F81 for ; Thu, 10 Feb 2005 13:12:08 +0000 (GMT) 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 56848-09 for ; Thu, 10 Feb 2005 13:11:55 +0000 (GMT) Received: from lakermmtao05.cox.net (lakermmtao05.cox.net [68.230.240.34]) by svr1.postgresql.org (Postfix) with ESMTP id C29EB8B9CE2 for ; Thu, 10 Feb 2005 13:11:57 +0000 (GMT) Received: from [192.168.0.17] (really [24.170.193.162]) by lakermmtao05.cox.net (InterMail vM.6.01.04.00 201-2131-117-20041022) with ESMTP id <20050210131157.IXBJ17924.lakermmtao05.cox.net@[192.168.0.17]>; Thu, 10 Feb 2005 08:11:57 -0500 From: Robert Treat To: Murray Cumming Subject: Re: Connecting without specifying a database Date: Thu, 10 Feb 2005 08:12:08 -0500 User-Agent: KMail/1.6.2 Cc: pgsql-interfaces References: <1108036223.3706.12.camel@localhost.localdomain> In-Reply-To: <1108036223.3706.12.camel@localhost.localdomain> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <200502100812.09410.xzilla@users.sourceforge.net> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200502/33 X-Sequence-Number: 5278 On Thursday 10 February 2005 06:50, Murray Cumming wrote: > Can PQconnectdb(), or something else, be used without specifying the > dbname in the connection string? I want to connect just so that I can > create a database that does not exist yet. > > When I don't specify the dbname, PQconnectdb() tries to connect to a > database with the same name as the user, and then complains that it does > not exist. Is it really necessary for each user to have an empty > database like this? Most applications choose to connect to template1 in these scenarios. -- Robert Treat Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL