Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YxQRQ-0004ob-4X for pgsql-bugs@arkaria.postgresql.org; Wed, 27 May 2015 01:47:32 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YxQRP-0001uI-DP for pgsql-bugs@arkaria.postgresql.org; Wed, 27 May 2015 01:47:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YxQRO-0001uC-MK for pgsql-bugs@postgresql.org; Wed, 27 May 2015 01:47:30 +0000 Received: from tamriel.snowman.net ([72.66.115.51]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1YxQRL-0003cV-G3 for pgsql-bugs@postgresql.org; Wed, 27 May 2015 01:47:30 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 39D5D5F7A0; Tue, 26 May 2015 21:46:25 -0400 (EDT) Date: Tue, 26 May 2015 21:46:25 -0400 From: Stephen Frost To: Alvaro Herrera Cc: Michael Paquier , PostgreSQL mailing lists Subject: Re: Incorrect processing of CREATE TRANSFORM with DDL deparding Message-ID: <20150527014625.GG26667@tamriel.snowman.net> References: <20150525155248.GG5885@postgresql.org> <20150526020243.GU26667@tamriel.snowman.net> <20150526144140.GT5885@postgresql.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="oRp91ajT7xRVOlj/" Content-Disposition: inline In-Reply-To: <20150526144140.GT5885@postgresql.org> X-Editor: Vim http://www.vim.org/ X-Info: http://www.snowman.net X-Operating-System: Linux/3.13.0-46-generic (x86_64) X-Uptime: 21:43:17 up 68 days, 7:31, 18 users, load average: 0.01, 0.06, 0.05 User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org --oRp91ajT7xRVOlj/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Alvaro, * Alvaro Herrera (alvherre@2ndquadrant.com) wrote: > Stephen Frost wrote: > > That said, I'm really not all that happy with the split between > > ProcessUtility() and ProcessUtilitySlow(). I've not said anything since > > I haven't got any great solutions to the issue, but it really is pretty > > grotty. I realize it might take a few extra cycles, but my thinking is > > along the lines of having an array or similar which we scan that > > indicates what is supported by deparse/event triggers, what isn't, etc, > > and then we operate based on that.. Perhaps an array which is indexed > > based on the NodeTag enum? >=20 > That doesn't work. Consider DropStmt for example; it is supported for > some object types, but not supported by others. There are a few other > commands for which this happens too. Also, NodeTag contains tags for > everything that can be a node: plan nodes for example, and for those it > doesn't even make sense to consider whether event triggers are > supported. Yeah, good points, all of them. > I suppose you could create a node type T_UtilityStmt and make all the > command nodes be sub-types of that one. But, except for the > ProcessUtility{Slow} code, it would be a loss in maintainability, ISTM, > and it would increase the size of every single utility node. >=20 > Now maybe with that you could get rid of (or centralize) various arrays; > see for example ObjectTypeMap and event_trigger_support, the calls to > pg_strcasecmp() in check_ddl_tag, EventTriggerSupportsObjectType() and > EventTriggerSupportsObjectClass() and > EventTriggerSupportsGrantObjectType() ... >=20 > Anyway this would solve the problem at hand anyway. I certainly agree that being able to centralize those arrays would be nice. It has definitely struck me, more than once, that we've got quite a few different arrays hanging around that might be better combined into one or at least kept in the same area. If nothing else, it might help minimize cases where individuals forget to update one or another of the arrays. Thanks! Stephen --oRp91ajT7xRVOlj/ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJVZSHwAAoJEO1sijiDR2RVh1gQAIZY9Wn70LZgVdjMUlNEP8eM oaM1DNjQ/Xo440pfS6t5XCqYFk1myz65NrfkKBIVh9gbrFVKQsLTWufujTNgxbcj 1j1lWcjLumOJj8BCOU7yJJhnPWXTaEytaqr/DMjqT4vTeqbghw53jqq+652vjGaS AyHwx0c9AbWOUJC3ljoGYUVaJSGolbhwItn9CxcUfjKEkwQjWro3XIaL6UI8kW4z jz/kzXN4h43LNB7dnQrW0ynnAHjS+8C7VG28pJPFGPkhhFSpo3jYvByReRGSF+7O 11mq/KM45ZAt5X/Tt8JqQeO27auYUU+Wl03KKMrVLvZMC+Jk6J3NHJ1wRyHPyafB Ocm/M3U1LcEDnyLt3s76yKEKWjfH1Mxsi+pdS0x6cYd5mHhATkbbvR/x666TnGWR 6wC4YLmwAwEdexmjCh/QLkh/SXfijwFgds80z2dDv9UGdK52RU5M/CERbxX2AJQu wW3d6blqtmNBPKF+hHZMRgzcf16tV3Bxw+M27RT0FZ9jd7fDfjnGXWub9RtpDHba ZA+LYgyg+wuOluo7SnV1T4kXlcmxRJg/yzXJVerGEJx2vLGuFPaE+Mt9sSif7vZ0 6T04vIsrPeuhxlWltHQRN7MmNmuFNm3qImJ8EOTFSocauNTfRJakqWgd89l8k4d7 MnVifPHgmMAQSTq15Q1H =kgW+ -----END PGP SIGNATURE----- --oRp91ajT7xRVOlj/--