Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tuO4d-007zMj-Od for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Mar 2025 03:57:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tuO4c-006tJ4-Gj for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Mar 2025 03:57:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tuO4b-006tIs-Pm for pgsql-hackers@lists.postgresql.org; Tue, 18 Mar 2025 03:57:02 +0000 Received: from fhigh-a6-smtp.messagingengine.com ([103.168.172.157]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tuO4Z-003R5o-2q for pgsql-hackers@lists.postgresql.org; Tue, 18 Mar 2025 03:57:00 +0000 Received: from phl-compute-12.internal (phl-compute-12.phl.internal [10.202.2.52]) by mailfhigh.phl.internal (Postfix) with ESMTP id BACCA1140282; Mon, 17 Mar 2025 23:56:58 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-12.internal (MEProxy); Mon, 17 Mar 2025 23:56:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1742270218; x=1742356618; bh=ZZBQ3MfXRZ U5EZi18va/1PmaMjbr2bg7Aj5h88ofFH8=; b=Dvs8tXvl0zgr6h4X8Td9Q/zBQm O4lk2KrxAxgsYrIt/OQZDkGQIvGPuVYb79Euh4wPAYI2K9rnoavrzyQrik5BtQ+g zUJ9H7hoAOn5upu5LKS43BG5b6lCzp1rNFLz7K/ZBr+NqdIGS4+uVNsRWSqNrqYC RxbiRUuv1HnJ4saRIsTUikgHBf8VPIctrM3WkF7a40u0/OtGSUJsL9tc/gbWcT3W gRtP9EgOaM6QXNMAyqqABS64wLDWKUHbgH0umiSIXwH+YgSEKH3eHnEO5Xt08o8i 8EFnpSivE2r0FYFWzcct2kN2OBuritHc1opdCdtjJhHxvwj5Mp75NKdfGFdQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1742270218; x=1742356618; bh=ZZBQ3MfXRZU5EZi18va/1PmaMjbr2bg7Aj5 h88ofFH8=; b=fYeuRYkrHf88e0qH7JzRCGeeirscGpQlv03q5vHMETpRv5W5uJC qppB0kBLK+DIDGdExwXZHcKmm7c3EzRp5SDTUfkobneqYNKjitAIjmRHzJJlsiI1 JHl+PYl/WEl2aFNdFd/fgd4E/o4nLO9GdUew4pyF/krFRSyJRE7MIFlLmX4XgIbP rwusTDJmooQOOxzsCnkyeuj+1GM1kRfU+ERUhGIrPPFn6z99Y7FVdZteINcQGS+E 6056sZCGE/4tkSJ8Ou8b8dfCr858HuSA5LkmVy6yvDd626bXPb3ADlJTwHgP1PJl 4P5DBWFXQucX/13w+FXcPPFpbBW9jR6dW9Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddugedufeekucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnegfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefu kfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivg hruceomhhitghhrggvlhesphgrqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhep teelieefudffhffhtdetleeggeegfffhkeeuveetiefgudduvedutefggeeivdejnecuve hluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggv lhesphgrqhhuihgvrhdrgiihiidpnhgspghrtghpthhtohepfedpmhhouggvpehsmhhtph houhhtpdhrtghpthhtohepmhihohhnseguvggsihgrnhdrohhrghdprhgtphhtthhopehp ghhsqhhlqdhhrggtkhgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrghdprh gtphhtthhopehmrgdutddtsehhohhtmhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 17 Mar 2025 23:56:56 -0400 (EDT) Date: Tue, 18 Mar 2025 12:56:42 +0900 From: Michael Paquier To: Christoph Berg Cc: PostgreSQL Hackers , ma lz Subject: Re: support fix query_id for temp table Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="mnrdN0pU3KuSQi1X" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --mnrdN0pU3KuSQi1X Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Mar 17, 2025 at 10:38:36PM +0100, Christoph Berg wrote: > Here's that patch with regression tests added. I would think changing > this would be a big usability improvement for anyone using temp tables > a lot. Not the first time I am seeing this argument this month. It is the second time. + /* + * If this is a temp table, jumble the name instead of the table oid. + */ + if (expr->rtekind == RTE_RELATION && isAnyTempNamespace(get_rel_namespace(expr->relid))) + { + rel_name = get_rel_name(expr->relid); + AppendJumble(jstate, (const unsigned char *)rel_name, strlen(rel_name)); + } + else + JUMBLE_FIELD(relid); This is OK on its own, still feels a bit incomplete, as the relid also includes an assumption about the namespace. I would suggested to add a hardcoded "pg_temp" here, to keep track of this assumption, at least. typedef struct RangeTblEntry { - pg_node_attr(custom_read_write) + pg_node_attr(custom_read_write, custom_query_jumble) This structure still includes some query_jumble_ignore, which are not required once custom_query_jumble is added. We had better document at the top of RangeTblEntry why we are using a custom function. -- Michael --mnrdN0pU3KuSQi1X Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmfY7voACgkQnvQgOdby QH1ihg/9GuC3F49Ot7RDytPn54dyu+OQoj7PQihTkyYePaVaCDQW0P8g0K4Tp3eJ lmYFwIH6/1BWmo7nzva22qLS7e2LZ1sn706VbBF3j3kdCIAk/nepLCUSGRH1ji6t NgZUv6KgZtU4Li8gAV983M5wjV4RpPg1B0J1X+j69wd+OnkZfonF0B+o7o7a71Cj 4qvzPFflDYb+ykEy5zmre5Dio4Zrr3vnyYgXwFQyCCNlAPs1CHlnN2jhXnknGp6a YomudU7GgEYM+9oy15BegwuK1ikqxhUfAV7jITtiEux1NKGWVRoQc6O5FWzBtVMy 2b2uYDYRAmH2Svyl7T4PVAV9mN/IiN5cLKU6+Ahg4v1amJAhO5FURrnZ/4Mz6rVt DqvwmF88Kg4Wv3WE/26BPW82Xq/NH9q1XLnQyQjFLNZ9x+ENCfKcFJjhTJpaqGCi 0JaPTL19DQ95C5XbLY8BekKugY4Fch/zy0MFjIiBVAl16Gpuxd+fBreDPBt3SbNP /daKXF53R5mzxlrebGWlJX7dEHHoB46v7w+XnuXqvjC4SguU8ZSOobvuaSmm6Kgr qanjiaqByBh/6ThyGcLz6b0u7Yu6JuE4ZCOaZTtpAbzF1kH+qbO7f9K0+C1AAowF AYvMDdWitj+7aJeAi8JNqdOUKt7g9/vEgvdMQBMpGboOE47bjIs= =ykf/ -----END PGP SIGNATURE----- --mnrdN0pU3KuSQi1X--