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 1iXnno-00041S-6R for pgsql-general@arkaria.postgresql.org; Thu, 21 Nov 2019 14:51:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iXnnm-0006Xj-U6 for pgsql-general@arkaria.postgresql.org; Thu, 21 Nov 2019 14:51:22 +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 1iXnnm-0006Xc-KD for pgsql-general@lists.postgresql.org; Thu, 21 Nov 2019 14:51:22 +0000 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iXnnj-00035X-EG for pgsql-general@lists.postgresql.org; Thu, 21 Nov 2019 14:51:22 +0000 Received: by mail-wm1-x343.google.com with SMTP id j18so7911691wmk.1 for ; Thu, 21 Nov 2019 06:51:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=A+DaxdOmYYq5773HIwmwEEEPQ2Q7zZmBumjPhUND644=; b=ByLSCDnrMtI8RmGPghU13x6gy35O4iQkZzoekexURKBcAVUqPpFo0FVNJic9Xdk8/X nbHG4syTwoZtt3r7EsKTrZ8eDMnTr94RwUwxkV6AWTmQV99ewPiWDOSuzJ6OElYiw3Y+ MU6FjZ9JrKclE8UhQJCSJmOIViTbKGfH9ZmzGwNl2ePq56PU6agz7syEzJ9lg6Tyuc39 +DZBzVka2XhCF1lu6/YjItiFxMCS2uOYZvULjjsC97cijgg8mVnc9Vr1uHqN0nRpCwFH +h+JnMiEy/XOADDD1lExR+fLI64ZwMn9yszR99ryw+fXC9DvBS9MA6G1PD/CTKQ9IvCW DLMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=A+DaxdOmYYq5773HIwmwEEEPQ2Q7zZmBumjPhUND644=; b=T66pEHzmpzsZvl0kFslaDPZ/q9yRk4Hw8tpXlbYfWXo9KkgYBhccLSnliu2MwnAewu J1amIVwlco1YRPhhFBqVj7zyhejQk0V76ENuUjxHjEwBC3aPXY17UQH6xYlpGjaO9cwP WlGXAOsLZyek/wpbJ7WgbyKDat+sXK1wtlhtC/6rrLW79cBXiYV/Q81IGX1wNv2EkxTx g/tLCerNvxeKnCSENplznCEeu31f8Yzo9jPHh5w7MhvcUcdKe4g/USs00kasFx+Fdsmi fcBteAz20ybE6SOY3/CTNx4AzI0eyWgLOtyjP5i7Yhcv4ewV/SafgRHA7R9HMjFSpLAG IUqw== X-Gm-Message-State: APjAAAVp6X+VrpfsCbejb0VVL8VPhfuX7ZeZo9OIIKHaVgpTfVeTIkvX H5e2XHnAoraeAPg8wxKZe/+G8w== X-Google-Smtp-Source: APXvYqxZSmhZ6yVbVCK20oUuiYxD1PdoY+46ReFwlk4YK4CbjwpN+G7LBnAtz5E+SesRUmzPhYjN5Q== X-Received: by 2002:a7b:c92e:: with SMTP id h14mr10658724wml.29.1574347877452; Thu, 21 Nov 2019 06:51:17 -0800 (PST) Received: from localhost.localdomain (217-149-171-82.nat.highway.telekom.at. [217.149.171.82]) by smtp.gmail.com with ESMTPSA id t185sm3429637wmf.45.2019.11.21.06.51.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Nov 2019 06:51:16 -0800 (PST) Message-ID: Subject: Re: Isolation of multiple databse instances provided by a single postgres server From: Laurenz Albe To: stan , Ron Cc: pgsql-general@lists.postgresql.org Date: Thu, 21 Nov 2019 15:51:16 +0100 In-Reply-To: <20191121115549.GA3417@panix.com> References: <20191120220353.GA24554@panix.com> <20191121115549.GA3417@panix.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.4 (3.32.4-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, 2019-11-21 at 06:55 -0500, stan wrote: > It seems to me that I can have one Postgres "server" running listening on a > single port on a single machine. It appears that the data files for this > "server" are managed internally by the Postgres server instance, and I > have no control of what is stored where in them. In an Oracle world, I can > create tablespaces, which have a relationship to OS files, and I can > explicitly control what objects are stored in which tablespaces (OS file), > thus, for example, when I do a hot backup, I put a specific tablespaces in > backup mode, and can then safely copy this OS file (yes I have to properly > deal with archive logs). Thus I would be somewhat comfortable have to > distinct "instance: provided by that one Oracle "server". > > It appears to me that, within this one Postgres "instance", there are 2 > levels of "isolation", which are database, and schemas. Is this correct? If > so, how does this cores pond to physical on disk storage? 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. - There can be several schemas in a database. 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 -- Cybertec | https://www.cybertec-postgresql.com