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 1iXoHB-00052N-A2 for pgsql-general@arkaria.postgresql.org; Thu, 21 Nov 2019 15:21: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 1iXoHA-0002SM-3I for pgsql-general@arkaria.postgresql.org; Thu, 21 Nov 2019 15:21: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 1iXoH7-0002Pn-V2 for pgsql-general@lists.postgresql.org; Thu, 21 Nov 2019 15:21:43 +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 1iXoH5-0003Kq-2S for pgsql-general@lists.postgresql.org; Thu, 21 Nov 2019 15:21:41 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 2AD9393E; Thu, 21 Nov 2019 10:21:37 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 21 Nov 2019 10:21:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= from:subject:to:cc:references:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=T Upsqj/pCmV9unMfSBuO8og8ydjb99J2UrCO+DqF5QU=; b=k0ZyrD3C6HopcGw7l 57Ef8aNERZmVm+BEvUmof4DkxVYYLngNMngXB60lUj42RnkuVvQv88Y7qFr5Dm+g r9y7eRsOJA+TBz8/zvjuJOvyOpp7G80yAFNug9YLVozY58jvdfl1qbwnRg4DqZ1p zF9wFDt8xS8VqRIaafP8jKWLYyGXS5F4xA6Y6kxprOv483tDf0UbdFWP/yEniQNp mJQ1pYQRmSAKJPG4nF0gxa5zkURtMRhy/a4wGLWfQkIQywd5foHUojqaAUyQ2sIC GTOhuSvCnknmxOFOLFLPM7GsLpf+SGvRfwpuIsRqQmEaYPiyFlhFNnKf8JzNoeDK a5JJQ== 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=X+E0eVnEFVO6L01y1zqvUKvbpGdBFCiUvfSTjEpZEKHdjI+KjLC6XxYdG D/wOaF+/NSR5J/EcAqy59RF405+GgnTkrSO/YTFukBGqnafzjdDqrfv1pHVB7AcA jZ4C4tQREu5Led1fLSgDeg2SS96fHL/1+HSpTHibf8u5JIz70GFNT9GI9Sj8GFLH vy9suGpCFQKcdESyRU/q9N6UtxpH9c3CopH4UmFSuAzDJ1ZR0/88ibBehB0Okte9 G74SS7Z/ibUzixGhcPOwlEDm52lkYKh5/meOwAeg5IaimHpD5S84mwrnUeJ5kxnp XU8f7VyWngUesCfKIUmbLOKvRksrw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrudehvddgjeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffuvfhfkffffgggjggtgfesthejredttdefjeenucfhrhhomheptegurhhi 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 05A0780059; Thu, 21 Nov 2019 10:21:35 -0500 (EST) From: Adrian Klaver 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> Message-ID: <3e96c131-73d2-e072-8c78-906b3d29e05a@aklaver.com> Date: Thu, 21 Nov 2019 07:21:35 -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