Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UA6yD-0000MJ-1z for pgsql-sql@arkaria.postgresql.org; Mon, 25 Feb 2013 22:56:29 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UA6yC-0002OS-Dq for pgsql-sql@arkaria.postgresql.org; Mon, 25 Feb 2013 22:56:28 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UA6yB-0002ON-NP for pgsql-sql@postgresql.org; Mon, 25 Feb 2013 22:56:27 +0000 Received: from mail-pb0-f51.google.com ([209.85.160.51]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UA6yA-0000Ij-H7 for pgsql-sql@postgresql.org; Mon, 25 Feb 2013 22:56:27 +0000 Received: by mail-pb0-f51.google.com with SMTP id un15so1947212pbc.10 for ; Mon, 25 Feb 2013 14:56:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=dhOv1GlBzIMEe8e5U2SDmzuDo/NiYiGMl5igalNaPoo=; b=HagXfLREf5VoG/bTqDI5Dx4U7YRyWesU/AhCJ8PyTYU4qlIW/VZ51RMHAbMHPnSoiU BQsf8U2KrLdRzK5tqItw7qPYyyXP90JYTA5D/Ryzbs2ANEMkOvx6uJyw153MDEp01RN1 gBi8IlRIJ7ZEi7vvqQlD6JyDGbWrWN1R1U2AaJKJ6+okxaDcn/bpW/7ooSKrVsxs4/WE 9N3RMkaBzOvsNJlJQdsHVWSglKJ3HEpm1+vbAHaRACLAbZOzVOnCMiZna/5yZMYNbtIB GyJlPyhV7p7hYDbFxPj1i46MJFT223PLA8NqlNKvzFJbso+kr+OzOroaRaB3a8DHZajR spRA== X-Received: by 10.68.138.197 with SMTP id qs5mr20565675pbb.121.1361832985556; Mon, 25 Feb 2013 14:56:25 -0800 (PST) Received: from [192.168.0.2] (c-24-17-164-54.hsd1.wa.comcast.net. [24.17.164.54]) by mx.google.com with ESMTPS id s9sm15150261pav.7.2013.02.25.14.56.23 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 25 Feb 2013 14:56:24 -0800 (PST) Message-ID: <512BEC17.6060403@gmail.com> Date: Mon, 25 Feb 2013 14:56:23 -0800 From: Adrian Klaver User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130215 Thunderbird/17.0.3 MIME-Version: 1.0 To: mkumbale CC: pgsql-sql@postgresql.org Subject: Re: Creating a new database with a TEMPLATE did not work References: <1361832568260-5746627.post@n5.nabble.com> In-Reply-To: <1361832568260-5746627.post@n5.nabble.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.5 (-) 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 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. > > Thanks, > Murali > > > > -- > View this message in context: http://postgresql.1045698.n5.nabble.com/Creating-a-new-database-with-a-TEMPLATE-did-not-work-tp5746627.html > Sent from the PostgreSQL - sql mailing list archive at Nabble.com. > > -- Adrian Klaver adrian.klaver@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql