Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fWLdB-0001Hs-2f for pgsql-general@arkaria.postgresql.org; Fri, 22 Jun 2018 12:57:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fWLd9-0005Fy-1E for pgsql-general@arkaria.postgresql.org; Fri, 22 Jun 2018 12:57:35 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fWLd6-0005Fq-Rt for pgsql-general@lists.postgresql.org; Fri, 22 Jun 2018 12:57:34 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fWLcy-0005cg-Vm for pgsql-general@postgresql.org; Fri, 22 Jun 2018 12:57:31 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id CAA8321B2A; Fri, 22 Jun 2018 08:57:23 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Fri, 22 Jun 2018 08:57:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=pfIpOBHYbj3iFxKxCiA7sNo/1xiE6 RYdDaodAH8sgGE=; b=nmjIYz9CzFDTFGrGjje2ZVDNm/jmaEeLmR4bYmloVL0PI oe5oM+efvz+ohJEkR5Okyt+Ehw69W+C2PoupzD3CkOoY/e8rVKRRyVObGEHO843y VeOXgMTEAR+/43+vqJQILZp1oN/GfO8N0qyMiHRYet076PLt0jKP/zc/J7NdPppW gNKwapOYMFeRb71GpCXQ6TNGnSYmpk1oJ7+XVh/sGBC6ipxgpgNJMKq014NgTZWz 5+Iy2rVX+ZYz7uDNG3lAv/sfCevhO0sIbiccnXFFAKFPuFO3q8GYRnxb70vcNgMZ Dv7CJbOQtIcCHOCxhluH/Y7vJFNO3LN/SJXOjlpGA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=pfIpOB HYbj3iFxKxCiA7sNo/1xiE6RYdDaodAH8sgGE=; b=FGdADSriNVVXIsrVS4AD5S 2DmnowQ/igpfuD5vooLXN2ekZRXwY4AkjRlc3LUSgw9iQ94ZDtFaDHT/3FO7Iauv 1KbpfeSih6pEHAj+wfy2sPBwm2WjQA02Gr62amX8ZOn+s9AP/fAItZz/a487Q4LJ BDpGfuo98by46Bh6RKb9AvwHtlfKo+vIzLdk7efPxyd/pCS4hB04rHxbyRdjOhJw kHjHmQ3dKgmyXimXtF4GMUJQtO2dSQdfLRoKyb4YFaTOtGvgQvO+83G7sbO24gL8 UWVuI+yPNz2Y6K2MWbZnrRjW4b6hBp3z1STc7njVf2kouFKtFjsh6pHWzexPQNow == X-ME-Proxy: X-ME-Sender: Received: from [192.168.1.3] (unknown [71.212.159.209]) by mail.messagingengine.com (Postfix) with ESMTPA id 25B70E442F; Fri, 22 Jun 2018 08:57:23 -0400 (EDT) Subject: Re: Copies or tables in schema or copiyng of database - database versioning To: =?UTF-8?Q?=c5=81ukasz_Jarych?= , "pgsql-general@postgresql.org >> PG-General Mailing List" References: From: Adrian Klaver Message-ID: <2dc9808b-78d7-a47c-c80e-b42919633295@aklaver.com> Date: Fri, 22 Jun 2018 05:57:22 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 06/22/2018 01:12 AM, Ɓukasz Jarych wrote: > Hi Guys, > > I want to create copies of tables in postgresql to use them by each user > in coherent way, > > So version 1 will be schema1, version 2 will be schema2 (with copies of > tables from version 1). > > How to perfom it ? > Using pg dump and creating new schemas (or databases is a better idea)? > > Or it is a way to write sql to create new schema and copying the older one? I am trying to understand what you want: 1) The tables will be exactly the same in each schema or will they differ? 2) Is a user going to be restricted to a particular schema? 3) What is the purpose of this layout? > > Best, > Jacek > -- Adrian Klaver adrian.klaver@aklaver.com