Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1clOoS-0001pC-VW for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Mar 2017 23:46:41 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1clOoS-0000oq-IB for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Mar 2017 23:46:40 +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_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1clOoQ-0000id-Gk for pgsql-hackers@postgresql.org; Tue, 07 Mar 2017 23:46:38 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1clOoN-0003MF-AB for pgsql-hackers@postgresql.org; Tue, 07 Mar 2017 23:46:38 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id A0B9120811; Tue, 7 Mar 2017 18:46:33 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute7.internal (MEProxy); Tue, 07 Mar 2017 18:46:33 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= smtpout; bh=0tpdDOI5zDGLFecykSn3MltbFL4=; b=GmlFsBNrjIjaAbl7dkqo 0goQOdAQyN63DpLj8kdKV7CVmojFEl3FIXXlUoUAkA2RQF/PJYqMp6cmZZfezIco s3Y22+VCcp7JGM64HO8zd1yjnwVO8NTs0BOw+iC+8rj8RZdXrsafzm40e41LvW6G 5uN7n+g4fmqK1oRedA9uYGU= X-ME-Sender: X-Sasl-enc: tRwQus9xXhQp5BfpTXn5qXL7ipefbnB9wnj5ZfQe6UsY 1488930393 Received: from april.local (c-73-13-66-39.hsd1.pa.comcast.net [73.13.66.39]) by mail.messagingengine.com (Postfix) with ESMTPA id 957C27E0CF; Tue, 7 Mar 2017 18:46:32 -0500 (EST) Subject: Re: WIP: Faster Expression Processing v4 To: Andres Freund , pgsql-hackers@postgresql.org References: <20161206034955.bh33paeralxbtluv@alap3.anarazel.de> <20170209003312.rr7atqepgbrf4xqe@alap3.anarazel.de> <20170307030137.lpo4japv5oqgbqpz@alap3.anarazel.de> Cc: Heikki Linnakangas , Doug Doole From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: <93169b65-6bfb-32c5-9a79-793e27da80d1@2ndquadrant.com> Date: Tue, 7 Mar 2017 18:46:31 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <20170307030137.lpo4japv5oqgbqpz@alap3.anarazel.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org I looked over 0001-Add-expression-dependencies-on-composite-type-whole-.patch. That seems useful independent of the things you have following. Even though it is presented more as a preparatory change, it appears to have noticeable user-facing impact, which we should analyze. For example, in the regression test, the command alter table tt14t drop column f3; is now rejected, rightly, but the command alter table tt14t drop column f3 cascade; ends up dropping the whole view, which might be a bit surprising. We don't support dropping columns from views, so there might be no alternative, but I wonder what else is changing because of this. I think that might deserve a bit more analysis and perhaps some test cases. --- a/src/backend/catalog/dependency.c +++ b/src/backend/catalog/dependency.c @@ -206,6 +206,9 @@ static bool object_address_present_add_flags(const ObjectAddress *object, static bool stack_address_present_add_flags(const ObjectAddress *object, int flags, ObjectAddressStack *stack); +static void add_type_addresses(Oid typeid, bool include_components, ObjectAddresses *addrs); +static void add_type_component_addresses(Oid typeid, ObjectAddresses *addrs); +static void add_class_component_addresses(Oid relid, ObjectAddresses *addrs); static void DeleteInitPrivs(const ObjectAddress *object); For some reason, the function add_object_address() is singular, and these new functions are plural Clearly, they take a plural argument, so your version seems more correct, but I wonder if we should keep that consistent. + * e.g. not to the right thing for column-less tables. Note that Small typo there. (to -> do) @@ -1639,6 +1641,9 @@ find_expr_references_walker(Node *node, add_object_address(OCLASS_PROC, funcexpr->funcid, 0, context->addrs); + /* dependency on type itself already exists via function */ + add_type_component_addresses(funcexpr->funcresulttype, context->addrs); + /* fall through to examine arguments */ } else if (IsA(node, OpExpr)) Why shouldn't the function itself also depend on the components of its return type? How are argument types handled? -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers