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 1iXupd-0002Dh-4I for pgsql-general@arkaria.postgresql.org; Thu, 21 Nov 2019 22:21:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iXupb-0004TJ-H2 for pgsql-general@arkaria.postgresql.org; Thu, 21 Nov 2019 22:21:43 +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 1iXupb-0004TC-7B for pgsql-general@lists.postgresql.org; Thu, 21 Nov 2019 22:21:43 +0000 Received: from mail.hjp.at ([212.17.106.138] helo=rorschach.hjp.at) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iXupS-0006rf-0I for pgsql-general@lists.postgresql.org; Thu, 21 Nov 2019 22:21:40 +0000 Received: by rorschach.hjp.at (Postfix, from userid 1000) id 7486415B4; Thu, 21 Nov 2019 23:21:32 +0100 (CET) Date: Thu, 21 Nov 2019 23:21:32 +0100 From: "Peter J. Holzer" To: pgsql-general@lists.postgresql.org Subject: Re: Isolation of multiple databse instances provided by a single postgres server Message-ID: <20191121222132.GD17288@hjp.at> References: <20191120220353.GA24554@panix.com> <20191121115549.GA3417@panix.com> <5c065b95-9f53-116c-1f23-2800eeeca744@aklaver.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="hxkXGo8AKqTJ+9QI" Content-Disposition: inline In-Reply-To: <5c065b95-9f53-116c-1f23-2800eeeca744@aklaver.com> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --hxkXGo8AKqTJ+9QI Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2019-11-21 07:21:10 -0800, Adrian Klaver wrote: > On 11/21/19 6:51 AM, Laurenz Albe wrote: > > - 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. >=20 > dblink(https://www.postgresql.org/docs/11/dblink.html) and > FDW(https://www.postgresql.org/docs/11/sql-createforeigntable.html) would > beg to differ. I was thinking of FDW. But I think Laurenz had the SQL syntax in mind which does include the database in the fully qualified form of a tablename. Something like db2=3D# select * from db2.public.t3; =E2=95=94=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=A4=E2=95=90=E2=95=90=E2= =95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95= =90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90= =E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=97 =E2=95=91 id =E2=94=82 t =E2=95=91 =E2=95=9F=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=95=A2 =E2=95=91 1 =E2=94=82 this is db2.public.t3 =E2=95=91 =E2=95=9A=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=A7=E2=95=90=E2=95=90=E2= =95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95= =90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90= =E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=9D (1 row) works. But when you try to access a table in a different database you get an error: db2=3D# select * from db1.public.t1; ERROR: cross-database references are not implemented: "db1.public.t1" LINE 1: select * from db1.public.t1; hp --=20 _ | Peter J. Holzer | Story must make more sense than reality. |_|_) | | | | | hjp@hjp.at | -- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" --hxkXGo8AKqTJ+9QI Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAl3XDewACgkQ8g5IURL+ KF1YoQ/+NEyeZ7DdmAtpDOSpMhorp8CaU+dSUjGFaxxiNutnXtEhQzqpjA39kxep J3MHqQEzbTuxro4hgIpBY2QLqwhMHo0LgGzp4wlis61poSo0k8SXQW6jqzf0QNCC 8Jg8wIUru56CUcKIlaPwhg6UqC+CbyfluOBfRX3WajwSkeupCyru+SXyQ0KDfQN3 TgGa96xeQAWbZefsBQV686IoLjsMjCFEKupkYPeUdX8Mia8YOVOvIA4BuQMRI3cF taI1b1iEZxV2okUKmpKuZc/LYT/rhrUCSSIgL3ySN+FInBgNLSOeP42rpFeD2KHf S2x4usRKEHFaS3H6K4gOH2Gtg5tSOPmdm/gpt8geMlV5JJF5b4l4CEfXw8S7QArt VvsFTWKIYN65ZJd+g10GO/vjokwXCLsUzd0mnR5CM8c88MRZytaC/+wslAImxOu4 shi5R0dA46nUStAHF4X/NmpHNsr0aMw4qSMBkwJ8jQKh27acuI7Qc3VjDzggpk2g mcN4JBzUJ84WBIw0Wi1AhWbxfIpifynv1e0443FDpoX1iXVm0HmEI/jK2PaLMWYl 1220xsaTQu4CGBWmFAj6fNPhPZGLqEjNSO6l7jsik5c+/Ab2lU1jAsRUIrFjVEL+ btF+E5npUlLKE0BzaaKjtdD0+T5WAq1TunZqKWmlHJJCMNa0lBc= =Gpou -----END PGP SIGNATURE----- --hxkXGo8AKqTJ+9QI--