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 1iocdi-0000Rf-6h for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Jan 2020 00:22:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iocdg-0006nn-PC for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Jan 2020 00:22:28 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iocde-0006na-KY for pgsql-hackers@lists.postgresql.org; Tue, 07 Jan 2020 00:22:28 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iocdb-0002uZ-KS for pgsql-hackers@lists.postgresql.org; Tue, 07 Jan 2020 00:22:25 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id AF795345; Mon, 6 Jan 2020 19:22:21 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 06 Jan 2020 19:22:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=BvvpPCM0x+iV/3zIUOQrYl2N3YF 5CsaZ5Mm0yVReTbo=; b=OsUyqOIp0Awcd1+PUyKogNv4wlRwTsaIyc6Vry4IZ7t 3ODoYCDpNxl4C6CtIN6CMuzapqqog05OkyvRBRHjWOtNptwZBqbjMXI8USaSqjm4 8ie37ATwMvagqT2t68uZSAlCIZFuWetEQyPDR1uPNFf3SNAqDWSudxW/QqbQIwue wT6oKuUhD9hWulldQNQE+B2pY2kObwIwnC0NTtxbJtP+2Kjbvl+fiV+2OrokSWtY PfaTNW0iy9xM7IFL3AaOSZMR2OISWXlK5f1TdFZ1XH1xKkt08WxdhO9/GTa5zzr6 f5lCCjlai5muJKnNVD0cVQ9vpQe+Zj3/MVKdeXEkawQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=BvvpPC M0x+iV/3zIUOQrYl2N3YF5CsaZ5Mm0yVReTbo=; b=JsX6rGGn9SJgwU3MRVh8E1 stXl+/zGpehc/bChnf1gyDb9XXtz8WWaK9e1vFDl1e+Zzy6KXO9LCwaVicScf4d/ O7esMwU4Itqe4LP4EIfHmc7/LQEldNczKpnKOosptmWUZ8BqZ/ezG/y+SWHbPwL+ tFKqs8hitS9K1TtVC2YKymp7MEEila2Mn2dLJnSN3u0WljFnb90d91BjorPv0L5X 4GBPIPy4Zjn0z1NnuBXkn/W10+cFCoFEGmPsiINRwYnuMbHYTFS/foOB9D/H9AR6 sybgxd5EYerSmcNuiJjUX3XSBHzFrQHheFIAIm8pJriJNFbC4HJDRqc57XN720YQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrvdehuddgvdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdlfeehmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucfkphepudduuddruddtvddrudektddrudekheenucfrrghr rghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiienucevlh hushhtvghrufhiiigvpedt X-ME-Proxy: Received: from paquier.xyz (ee0822lan1.rev.em-net.ne.jp [111.102.180.185]) by mail.messagingengine.com (Postfix) with ESMTPA id 27E1D80062; Mon, 6 Jan 2020 19:22:18 -0500 (EST) Date: Tue, 7 Jan 2020 09:22:16 +0900 From: Michael Paquier To: Tom Lane Cc: Robert Haas , Mahendra Singh , Kyotaro Horiguchi , PostgreSQL Hackers Subject: Re: Assert failure due to "drop schema pg_temp_3 cascade" for temporary tables and \d+ is not showing any info after drooping temp table schema Message-ID: <20200107002216.GA2386@paquier.xyz> References: <20191225032410.GG3448@paquier.xyz> <20191226135329.GA249363@paquier.xyz> <28862.1577382716@sss.pgh.pa.us> <20191227090604.GA540891@paquier.xyz> <20200106014202.GA3598@paquier.xyz> <31319.1578332027@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="sm4nu43k4a2Rpi4c" Content-Disposition: inline In-Reply-To: <31319.1578332027@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --sm4nu43k4a2Rpi4c Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 06, 2020 at 12:33:47PM -0500, Tom Lane wrote: > Robert Haas writes: >> I'm not arguing for a revert of 246a6c8. I think we should just change = this: >> ... >> To look more like: >=20 >> char *nspname =3D get_namespace_name(classForm->relnamespace); >> if (nspname !=3D NULL) >> ereport(..."autovacuum: dropping orphan temp table \"%s.%s.%s\"...) >> else >> ereport(..."autovacuum: dropping orphan temp table with OID %u"....) >=20 >> If we do that, then I think we can just revert >> a052f6cbb84e5630d50b68586cecc127e64be639 completely. >=20 > +1 to both of those --- although I think we could still provide the > table name in the null-nspname case. Okay for the first one, printing the OID sounds like a good idea. Like Tom, I would prefer keeping the relation name with "(null)" for the schema name. Or even better, could we just print the OID all the time? What's preventing us from showing that information in the first place? And that still looks good to have when debugging issues IMO for orphaned entries. For the second one, I would really wish that we keep the restriction put in place by a052f6c until we actually figure out how to make the operation safe in the ways we want it to work because this puts the catalogs into an inconsistent state for any object type able to use a temporary schema, like functions, domains etc. for example able to use "pg_temp" as a synonym for the temp namespace name. And any connected user is able to do that. On top of that, except for tables, these could remain as orphaned entries after a crash, no? Allowing the operation only via allow_system_table_mods gives an exit path actually if you really wish to do so, which is fine by me as startup controls that, aka an administrator. In short, I don't think that it is sane to keep in place the property, visibly accidental (?) for any user to create inconsistent catalog entries using a static state in the session which is incorrect in namespace.c, except if we make DROP SCHEMA on a temporary schema have a behavior close to DISCARD TEMP. Again, for the owner of the session that's simple, no clear idea how to do that safely when the drop is done from another session not owning the temp schema. > Maybe we haven't. It's not clear that infrequent autovac crashes would > get reported to us, or that we'd successfully find the cause if they were. >=20 > I think what you propose above is a back-patchable bug fix. Yeah, likely it is safer to fix the logs in the long run down to 9.4. -- Michael --sm4nu43k4a2Rpi4c Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl4TzzgACgkQnvQgOdby QH32PhAAm2wDEWWorkCHTHG3CRC6ywUdX8KaRCxoS5zySEpkbdERLu7Ci7+MXFrQ 05q6fC0LfuTCfRb5+phFFXvgN5xpHySvvzE2/+i4KE19O+OTsLQ7uqcxaUNKDziF X+m5/w2MuIEdAXnPl+0YI1JUs7w1k26FRLpBk38GgtRJhWZjzwKrppXYN8OoLAzU SdNHKOyCBXbUFVSTBn5G1O0JdsnOkZrjP/a0ilC1yZqsX+TbnKxMhzLbvAcCVrWG b6VQMZQarJQASIR2Pcdjoa0uunDEL0gAKZ1WWSYUSM3TeEiJcfvNr6oBdZO2iEuC uCWjAw9D3jplolWKmkqVUf2LvHVChTeE70bDzj5aBTBfl8R+rB7gG+hkdHZyefNy mB2kBo0njb1Bz45IUBPhswBSG1YJriFEfJPBOlLzby49tNH+Mx0RvLE9kIAmvy7P ZVRep0vCVLQN6eGrUKeW6+UZc6fd3E0LOQdw6s/Xz0KMN7a/y5UacgBB8IfQkAn5 atHX5Mi8X8ir6JmsDgQlemfXEw0IBrqUzzzLoVgXU3Bt+Z/Uc0gdW2D2OoAVzFsr /+wJbcF6FqorOhbeq3M8tmRbfuImBreWOxlUAvaWocfcp7Oh3bnthT8na2oJT164 OgXddTEGiM8OmTxNveShXVZU2Ea8kxxXsEdnEfbM5qh+Tj5Xcs0= =I9wD -----END PGP SIGNATURE----- --sm4nu43k4a2Rpi4c--