Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvjkV-0007H5-Ue for pgsql-hackers@arkaria.postgresql.org; Sat, 23 Sep 2017 12:41:36 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dvjkV-00063V-8M for pgsql-hackers@arkaria.postgresql.org; Sat, 23 Sep 2017 12:41:35 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dvjkR-0005y6-PK for pgsql-hackers@postgresql.org; Sat, 23 Sep 2017 12:41:32 +0000 Received: from mail-yw0-x22a.google.com ([2607:f8b0:4002:c05::22a]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dvjkO-0006X9-F5 for pgsql-hackers@postgresql.org; Sat, 23 Sep 2017 12:41:29 +0000 Received: by mail-yw0-x22a.google.com with SMTP id o143so2276159ywd.12 for ; Sat, 23 Sep 2017 05:41:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=from:subject:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=fmE44vxyEGZmQRZ25ZJnNiGxu3dc3SlZtQmNxie9/Lg=; b=aD6BIN10WIV9i4Y934KXCR4DaBsOyPKTVB0h/Vu83oqEJhfXh/BUdMuTw5gia5nnbE AmRZiD65xgpW4DfSlzU4lMW5B+pX+jLaxtkTjm/v4xZUsJfiZe7hJchGfFWuBFk8CWlY 0iZAP8EMyw25khvkHJ0znvKf5lCmbFrUbod/pmy1kIOhfCoyTCJfyEukZD24yVD4Yzft zGayaMpmJzNLuo68FI0ThWk3OQ3uF1xVnSdOZuYgg9jJkcigQqA7vqyTOAlqhD3lLObp VZBSmfw/bdoF/T8lfk290eAdbBpISsFAWJLRb/0lAN5aaH2f8igYAcXGT3Lum2cCd8BG 301g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=fmE44vxyEGZmQRZ25ZJnNiGxu3dc3SlZtQmNxie9/Lg=; b=Bw1zAjfW0YKJpqAeIQ2CQd2oBiSNUqsfJMyOPDem9NE64pp7FIe9bBl3TJXCQba15G PQlCduagDYlxB8AXL8ue/K5VsZfGWDBVCiNhEf4ewF1/L2NFij22aGP8aph8q80BfbxV b6vaXdoWGL4T8cLG86buKa/wKckx6WwVzBnYhr2IpltyYjk95F09n88c0VLi2FVc+LvS DOQ/Hd5h0wBdoD4whTrqRdlzG/jzy6N3AJznO+XuIWf8wD8dXHZmNgOnNRc4mdVbS2jG U6kgggG0VCF5FNRjf5um/8efgTRZ2Nq3vmqW5gBUCAVv0k2wXL6gJgr5z7PnL3j+BKpC btPA== X-Gm-Message-State: AHPjjUgopZ/8Dq74puTBqZrGUsETtcRPvYMgngcUWoD22T2+xzyZSxX/ XEpPmnGr3qG6bhkZYTlE59pnjHWZ7vbn4829e5vQVM9KJUdUmy6OdU0+/Uv5bNRhBxjsuilzMEY SspZ10WHdt38aKv69BwWtvUDkrebAxJjytStm0STWoZ8BpKfQQ/l2DMT3GCR9dZzm1785qQNGZ3 hQmxf3YNs6wSRr X-Google-Smtp-Source: AOwi7QA/iMRqrwLXYxQ2iPtfLLAV3U7mw78UHRSTZOnr5bSX0kfl/4dKNFiw1USPFskQ17JG3iJNXQ== X-Received: by 10.37.219.133 with SMTP id g127mr1311720ybf.118.1506170487277; Sat, 23 Sep 2017 05:41:27 -0700 (PDT) Received: from [192.168.10.146] ([98.122.175.38]) by smtp.gmail.com with ESMTPSA id n7sm908955ywh.59.2017.09.23.05.41.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Sep 2017 05:41:26 -0700 (PDT) From: Andrew Dunstan X-Google-Original-From: Andrew Dunstan Subject: Re: [BUGS] BUG #14825: enum type: unsafe use? To: Tom Lane Cc: balazs@obiserver.hu, pgsql-bugs@postgresql.org, pgsql-hackers@postgresql.org References: <20170922185904.1448.16585@wrigleys.postgresql.org> <15165.1506116768@sss.pgh.pa.us> <3cece400-af56-7145-2e65-f044de1b0b68@2ndQuadrant.com> <28968.1506136792@sss.pgh.pa.us> Message-ID: Date: Sat, 23 Sep 2017 08:41:25 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <28968.1506136792@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-MW 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 On 09/22/2017 11:19 PM, Tom Lane wrote: > Andrew Dunstan writes: >> On 09/22/2017 05:46 PM, Tom Lane wrote: >>> I'm not sure if that qualifies as a stop-ship problem, but it ain't >>> good, for sure. We need to look at whether we should revert 15bc038f9 >>> or somehow revise its rules. >> I wonder if we wouldn't be better >> doing this more directly, keeping a per-transaction hash of unsafe enum >> values (which will almost always be empty). It might even speed up the >> check. > Yeah, I was considering the same thing over dinner, though I'd phrase > it oppositely: keep a list of enum type OIDs created in the current > transaction, so that we could whitelist them. This could maybe become > a problem if someone created a zillion enums in one xact, though. I see what you're saying, but my idea was slightly different. We would only add to the hashtable I had in mind at the bottom AddEnumLabel(). Any other value, whether added in the current transaction or not, should be safe, AIUI. Maybe we should also keep a cache of whitelisted enums created in the current transaction. I'm not to worried about people creating a zillion enums (or enum labels being added for the solution I had in mind). Even a hash of a million Oids will only consume a few megabytes, won't it? > > The immediate question is do we care to design/implement such a thing > post-RC1. I'd have to vote "no". I think the most prudent thing to > do is revert 15bc038f9 and then have another go at it during the v11 > cycle. > > Sadly I agree. We've made decisions like this in the past, and I have generally been supportive of them. I think this is the first time I have been on the receiving end of one so late in the process :-( cheers andrew -- Andrew Dunstan https://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