Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iXoK6-00057j-Im for pgsql-general@arkaria.postgresql.org; Thu, 21 Nov 2019 15:24:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iXoK4-0001Y0-QP for pgsql-general@arkaria.postgresql.org; Thu, 21 Nov 2019 15:24:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iXoHA-0002SL-8o for pgsql-general@lists.postgresql.org; Thu, 21 Nov 2019 15:21:44 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iXoH1-0003Kh-Eq for pgsql-general@lists.postgresql.org; Thu, 21 Nov 2019 15:21:43 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id E9AD070F; Thu, 21 Nov 2019 10:21:12 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 21 Nov 2019 10:21:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=T Upsqj/pCmV9unMfSBuO8og8ydjb99J2UrCO+DqF5QU=; b=ufhk8kaiSFwuDVhyn YnK6rzBLsvYAhvnJbPOK/VOcE30lFAkVCfYeNEASwI801d0yKb19s39CUSk1AMoA 8nduS73Jg+IaSGdEyhxOxOGLVhPux0geAgWjf93y58SRMdbgUNkPVpMOwV3Wt4Oh eF2+dFwxQTdGEJps8vucW258gkqsSH5/FYtgmr7mlyCCcqTt4/DemFHpsuWoc/3G at2Sx5bpiNb0BVnUxnyGZxn58Dl5NaLQ3ImRdsRy4N62DDudYznk0W1VtdEN5935 ogI3sCiF2HvEXfcvdZPpd+w0zuKDCiiAzvTNBs5seM174+n0m3nCtP7PPgZtZ+oo LR02g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=TUpsqj/pCmV9unMfSBuO8og8ydjb99J2UrCO+DqF5 QU=; b=yAJpTov6Wegv1lvi3jfeFtySvpo2Vq4BPw6+rqUIfJLCAfsAbd2N7qmAG 9ud7rHyqWvcEAI+SdOQPw8DWD5e6eayNFwTEx+/DiH2TbZZ01ahFaVp/2O6Ch/D2 /ATIIqz5s4pC1gpaC107ptFYCUj0EGP2v+KzB5uSuEfRVtFSO/eyP8UXZMpttfYW W41Dcxxh3eSwxwpjB8DNkihKS5zdd0BVNn8K2sSST/bJJvEuuW1GexVaNjr1NBZD O0GpT59Cik1e1C2xcnRwHTZ5xJ0/Wak4vDGgexKFvxtwzroT4UVKZnroZU1W9J9n xrYAjmlqtpo+F8wAXcc7+YepuJ0OA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrudehvddgjeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthejredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgnecukfhppeejuddrvddu vddrudeffedruddukeenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghnrdhklh grvhgvrhesrghklhgrvhgvrhdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from [192.168.1.2] (unknown [71.212.133.118]) by mail.messagingengine.com (Postfix) with ESMTPA id 626148005B; Thu, 21 Nov 2019 10:21:11 -0500 (EST) Subject: Re: Isolation of multiple databse instances provided by a single postgres server To: Laurenz Albe , stan , Ron Cc: pgsql-general@lists.postgresql.org References: <20191120220353.GA24554@panix.com> <20191121115549.GA3417@panix.com> From: Adrian Klaver Message-ID: <5c065b95-9f53-116c-1f23-2800eeeca744@aklaver.com> Date: Thu, 21 Nov 2019 07:21:10 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 11/21/19 6:51 AM, Laurenz Albe wrote: > On Thu, 2019-11-21 at 06:55 -0500, stan wrote: > You can use tablespaces in PostgreSQL, which are directories on a > different file system, to put your data elsewhere. > But that has very limited use-cases, and normally you don't > create a tablespace. > > About isolation: > - The different databases in a cluster are physically located in > the same tablespace, but they are logically strictly separated. > You cannot connect to one database and access another database from there. dblink(https://www.postgresql.org/docs/11/dblink.html) and FDW(https://www.postgresql.org/docs/11/sql-createforeigntable.html) would beg to differ. > > - There can be several schemas in a database. There are several schemas in a database. In a new database: test=# \dnS List of schemas Name | Owner --------------------+---------- information_schema | postgres pg_catalog | postgres pg_temp_1 | postgres pg_toast | postgres pg_toast_temp_1 | postgres public | postgres > You can access a table in a schema if you have the required privilege > on both the schema and the table. > > This is entirely independent of physical storage, which is provided > by tablespaces. Tables from different databases can be located in the > same tablespace and vice versa. > > Think of "database" and "schema" as a logical separation in SQL. > > You cannot backup and restore an individual tablespace, only the > whole cluster. > > Yours, > Laurenz Albe > -- Adrian Klaver adrian.klaver@aklaver.com