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 1ihGP2-0002U3-Er for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Dec 2019 17:12:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ihGP0-0006xx-Sj for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Dec 2019 17:12:54 +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 1ihGP0-0006xq-G4 for pgsql-hackers@lists.postgresql.org; Tue, 17 Dec 2019 17:12:54 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ihGOx-0007HU-VW for pgsql-hackers@lists.postgresql.org; Tue, 17 Dec 2019 17:12:53 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id xBHHCnS4005362; Tue, 17 Dec 2019 12:12:49 -0500 From: Tom Lane To: Amit Langote cc: PostgreSQL Hackers Subject: Re: unsupportable composite type partition keys In-reply-to: References: Comments: In-reply-to Amit Langote message dated "Tue, 17 Dec 2019 18:03:42 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <5360.1576602769.1@sss.pgh.pa.us> Date: Tue, 17 Dec 2019 12:12:49 -0500 Message-ID: <5361.1576602769@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Amit Langote writes: > It seems to me that we currently allow expressions that are anonymous > and self-referencing composite type records as partition key, but > shouldn't. Allowing them leads to this: Hm. Seems like the restrictions here ought to be just about the same as on index columns, no? That is, it should be roughly a test like "no pseudo-types". The check you're proposing seems awfully specific, and I doubt that the equivalent check in CREATE INDEX looks the same. (But I didn't go look ... I might be wrong.) regards, tom lane