From dev_hyd2001@yahoo.com Thu Jul 10 13:24:20 2008 Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 91E0465032E for ; Thu, 10 Jul 2008 10:24:20 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 68294-08 for ; Thu, 10 Jul 2008 10:24:11 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from web53710.mail.re2.yahoo.com (web53710.mail.re2.yahoo.com [206.190.37.31]) by postgresql.org (Postfix) with SMTP id 83F08650162 for ; Thu, 10 Jul 2008 10:24:16 -0300 (ADT) Received: (qmail 96157 invoked by uid 60001); 10 Jul 2008 13:24:15 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:X-Mailer:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type:Message-ID; b=CqtY2xqFinv1OGDtNVnbSXjRztoYffcfcHuCOhNCZWbacN/4AO4S5RT48sew5oT1y8xw42T9FNplRRHTbmWLt3Q98MFnr9pqKBdMLYbZJ4wbBz9hffiYt55aAQzpYd4LJP42rmcAz/eamNiD0qjU2Ax2i70+IIa66S9jx11cfzw=; Received: from [82.182.120.68] by web53710.mail.re2.yahoo.com via HTTP; Thu, 10 Jul 2008 06:24:14 PDT X-Mailer: YahooMailWebService/0.7.199 Date: Thu, 10 Jul 2008 06:24:14 -0700 (PDT) From: Dev Reply-To: dev_hyd2001@yahoo.com Subject: create database with template question To: pgsql-admin@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1987921957-1215696254=:95815" Message-ID: <962504.95815.qm@web53710.mail.re2.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.517 tagged_above=0 required=5 tests=AWL=0.516, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200807/103 X-Sequence-Number: 29713 --0-1987921957-1215696254=:95815 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi, =A0=A0=A0=A0=A0=A0=A0 I have a database with a table and some triggers and = functions set on it. I converted it into a template setting the fields data= llowcon=3Dfalse and datistemplate=3Dtrue on it. Lets assume this template(d= atabase) is called as mytemplate. Now, as a normal database user I issue the create database command and spec= ify mytemplate i.e=20 create database testdb template mytemplate; Everything works fine except that the table in the newly created testdb is = still the user postgres, the one who created the template database. Is this expected behavior or am I missing something? /Dev =0A=0A=0A --0-1987921957-1215696254=:95815 Content-Type: text/html; charset=us-ascii
Hi,

        I have a database with a table and some triggers and functions set on it. I converted it into a template setting the fields datallowcon=false and datistemplate=true on it. Lets assume this template(database) is called as mytemplate.

Now, as a normal database user I issue the create database command and specify mytemplate

i.e

create database testdb template mytemplate;

Everything works fine except that the table in the newly created testdb is still the user postgres, the one who created the template database.

Is this expected behavior or am I missing something?


/Dev

--0-1987921957-1215696254=:95815-- From scott.marlowe@gmail.com Thu Jul 10 14:33:25 2008 Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id D83F065052F for ; Thu, 10 Jul 2008 11:33:25 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 33154-03 for ; Thu, 10 Jul 2008 11:33:13 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from yx-out-2324.google.com (yx-out-2324.google.com [74.125.44.30]) by postgresql.org (Postfix) with ESMTP id 9FEF465050C for ; Thu, 10 Jul 2008 11:33:19 -0300 (ADT) Received: by yx-out-2324.google.com with SMTP id 8so938400yxb.73 for ; Thu, 10 Jul 2008 07:33:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=ZB0aLNn7yOfGLPBwSFhIqw8LKN/vUnwbXcc/n9qwsxY=; b=IkHc173S5U/cKC943eYBLUi8Kb931wYyHGhA7yfRs8sRizXKZ8x0t9V9aW5XNR9sqv KIPn1Fzu9azPCjopj1i3uDVK/FAr1+fyNbq9DHFYu139K6Y2fEP1gPZwMQYUqf5i8E+F 2jGZ38VH4vw9Do8XLkBUVbZP0kU5gurjb9/Lk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=Tf4wd1hSnU8wIFLNWFaTNtVQxXWkrsjodhMxecuxPaRNRE/F7mdBP0MKaK5iJtLdZT nbxTSIHHU6Rj8YzG8Wi/kabSXYoyaraMBbDlyXdJgoLxuT9CdfwSDNIJNHXvikryWGB5 qlXJkN08mnJl3TVGZEBqMtTb3x9LKT2HHPm6E= Received: by 10.115.47.1 with SMTP id z1mr10960831waj.129.1215700397315; Thu, 10 Jul 2008 07:33:17 -0700 (PDT) Received: by 10.114.130.17 with HTTP; Thu, 10 Jul 2008 07:33:17 -0700 (PDT) Message-ID: Date: Thu, 10 Jul 2008 08:33:17 -0600 From: "Scott Marlowe" To: dev_hyd2001@yahoo.com Subject: Re: create database with template question Cc: pgsql-admin@postgresql.org In-Reply-To: <962504.95815.qm@web53710.mail.re2.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <962504.95815.qm@web53710.mail.re2.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200807/104 X-Sequence-Number: 29714 On Thu, Jul 10, 2008 at 7:24 AM, Dev wrote: > Hi, > > I have a database with a table and some triggers and functions set > on it. I converted it into a template setting the fields datallowcon=false > and datistemplate=true on it. Lets assume this template(database) is called > as mytemplate. > > Now, as a normal database user I issue the create database command and > specify mytemplate > > i.e > > create database testdb template mytemplate; > > Everything works fine except that the table in the newly created testdb is > still the user postgres, the one who created the template database. > > Is this expected behavior or am I missing something? expected behaviour.