Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UAAZJ-000199-Im for pgsql-sql@arkaria.postgresql.org; Tue, 26 Feb 2013 02:47:02 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UAAZI-0005yt-UV for pgsql-sql@arkaria.postgresql.org; Tue, 26 Feb 2013 02:47:00 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UAAZH-0005yn-H3 for pgsql-sql@postgresql.org; Tue, 26 Feb 2013 02:46:59 +0000 Received: from isis.morrow.me.uk ([204.109.63.142]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UAAZF-0003r0-Lo for pgsql-sql@postgresql.org; Tue, 26 Feb 2013 02:46:58 +0000 Received: from anubis.morrow.me.uk (host86-173-252-4.range86-173.btcentralplus.com [86.173.252.4]) (Authenticated sender: mauzo) by isis.morrow.me.uk (Postfix) with ESMTPSA id AC20F450CE for ; Tue, 26 Feb 2013 02:46:56 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.7.4 isis.morrow.me.uk AC20F450CE DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=morrow.me.uk; s=dkim201101; t=1361846816; bh=rqRnCqMI+tZh8lpbYBGUfulBftQ2mgCV5rYrVL5l0Nc=; h=Date:From:To:Subject:References:In-Reply-To; b=M8xxzq3+BcjRsNe/DG257VTD+9ALwFJ1JrUazf6uIMs6F0UG3tUPaxHHQr5OKzCbQ xL5/VRGrCRlGUIfrjViQfmV4Gja7tSBNs0r109mwfRUetAU7czImRQE7QfFdA1uKo8 mGPbCw+9SU9AKCcfNxpR+mMRnE6M0Egj4LKOEPZ4= X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.97.6 at isis.morrow.me.uk Received: by anubis.morrow.me.uk (Postfix, from userid 5001) id C3EE494B2; Tue, 26 Feb 2013 02:46:54 +0000 (GMT) Date: Tue, 26 Feb 2013 02:46:54 +0000 From: Ben Morrow To: pgsql-sql@postgresql.org Subject: Re: Creating a new database with a TEMPLATE did not work Message-ID: <20130226024654.GA64903@anubis.morrow.me.uk> References: <1361832568260-5746627.post@n5.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <512BEC17.6060403@gmail.com> X-Newsgroups: pgsql.sql Organization: morrow.me.uk User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org Quoth adrian.klaver@gmail.com (Adrian Klaver): > On 02/25/2013 02:49 PM, mkumbale wrote: > > Hi, I am new to PostgreSQL. I have an empty PostgreSQL DB containing tables > > but no data. I issued the following command in PGADMIN SQL editor: > > > > CREATE DATABASE "NewDefault" > > WITH OWNER = postgres > > ENCODING = 'UTF8' > > TEMPLATE = Default > > TABLESPACE = pg_default > > LC_COLLATE = 'English_United States.1252' > > LC_CTYPE = 'English_United States.1252' > > CONNECTION LIMIT = -1; > > > > Although it created the NewDefault DB, it does not contain any of the tables > > in Default. Default was disconnected when I executed this command. > > > > What am I doing something wrong? > > So you have a database named Default? > > Probably not a good name because: > http://www.postgresql.org/docs/9.2/interactive/sql-createdatabase.html > > template > The name of the template from which to create the new database, or > DEFAULT to use the default template (template1). > > So at a guess you are actually creating the new database from template1. Also, SQL names are folded to lowercase unless they are quoted, so TEMPLATE = Default would refer to a database called "default" (if it weren't special syntax for template1), but TEMPLATE = "Default" should find a database created with CREATE DATABASE "Default". Ben -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql