Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dwvcD-0005Pe-Fl for pgsql-bugs@arkaria.postgresql.org; Tue, 26 Sep 2017 19:33:57 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dwvcC-0001Ad-VT for pgsql-bugs@arkaria.postgresql.org; Tue, 26 Sep 2017 19:33:57 +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 1dwvbT-00075j-Rt for pgsql-bugs@postgresql.org; Tue, 26 Sep 2017 19:33:11 +0000 Received: from mail-qt0-x22f.google.com ([2607:f8b0:400d:c0d::22f]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dwvbO-0004YI-VB for pgsql-bugs@postgresql.org; Tue, 26 Sep 2017 19:33:11 +0000 Received: by mail-qt0-x22f.google.com with SMTP id o52so11502290qtc.9 for ; Tue, 26 Sep 2017 12:33:06 -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=c1dDs2mSYwMPLM1PyYj4/OJKcuvvR4za1rnaBdf04jI=; b=VHl79XZZYsRes71J/1AUypfr6IKeF8WTK0VKqw/gl3idWGdF4cRUnuX3R2wKbOfh0i BL+sZfkp79mA2GB/eQJPEab4PopG+jad1STSNprqkxxgtgu399YPeiC/L1ySmFLL6RiI yrZCMqQPU+3VhvgVsLN/gDtQmIKsDCzR9/oQzHe85zDXdcHF5LBQm19LUwjg3luf1vLs ebnI7kH0RXOAh9F3VrTVANctQQ53hFh1LmHTEnnyYn2voef5LIYj3hR3ZVQIC7oYRAm8 8orTtLT3PHc3uT6a/rEt1xSHKuZpBAW7Y/tf7hH9hP08eH/2SRSLZZrmNnvTKHvO/ukJ uilg== 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=c1dDs2mSYwMPLM1PyYj4/OJKcuvvR4za1rnaBdf04jI=; b=KMPJaOUjsGMSlwbCQGfxXz+p2iIuRixgdL1aLZAIhlvd23ZIn15sSSKHJq4haJiil9 KKD/t9Pd9D4lOEIOhA01OXJVI4vviV7NzHjB7Pb/2/iZLkNQLXE2SxY0tvfxFpGQhgu/ Vreqlieau6q/2rkIZvLbEu+Cdwn9pPL8QB27duTYF4IqUEoLINxU4+nCXJ+GFtsPwZkf mkurhAxmjfR5ZfsSybkNMkND933rs8e0JABbV2JfGYGEopvjoTKZjghosqIPwWKNGu67 EY4sBY/Im5gl2XFw8afiviiikLnsZPNe2R85Fqtpr+ZGpAohIdnh/J80pqYRAJOkS7DH T5hQ== X-Gm-Message-State: AHPjjUiDiitIwxtfvleBxhWl/jCfl9D3lOiGbCUeUR40VJzxV1nxgkZW N6mG66FKoeHTvA0lm2Qszt0s X-Google-Smtp-Source: AOwi7QDn1UblXUrEbRqwpyD9KVS1iwDKeHbGmL0hX8Hdu0YLgjPiYqsP13TpxuFaRLnVAHlxjQ4pEw== X-Received: by 10.237.53.229 with SMTP id d34mr16747857qte.97.1506454385094; Tue, 26 Sep 2017 12:33:05 -0700 (PDT) Received: from [192.168.10.146] ([98.122.175.38]) by smtp.gmail.com with ESMTPSA id f34sm4922244qtb.40.2017.09.26.12.33.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Sep 2017 12:33:04 -0700 (PDT) From: Andrew Dunstan X-Google-Original-From: Andrew Dunstan Subject: Re: BUG #14825: enum type: unsafe use? To: Tom Lane Cc: "David E. Wheeler" , Christophe Pettus , pgsql-bugs@postgresql.org, pgsql-hackers@postgresql.org References: <20170922185904.1448.16585@wrigleys.postgresql.org> <24380.1506179805@sss.pgh.pa.us> <16272.1506189656@sss.pgh.pa.us> <928f5974-151f-0273-0221-fac213e7624f@2ndQuadrant.com> <19137.1506196325@sss.pgh.pa.us> <4942e2c0-3302-f496-d4c1-a967f77d0143@2ndQuadrant.com> <25662.1506204381@sss.pgh.pa.us> <9479302a-09b8-4264-f9c4-514b65f18547@2ndQuadrant.com> <18127.1506285450@sss.pgh.pa.us> <2770f70a-5977-3fa1-1065-11b4cc69f07f@2ndQuadrant.com> <23438.1506294409@sss.pgh.pa.us> <25809.1506348877@sss.pgh.pa.us> <27064.1506350579@sss.pgh.pa.us> <5f4f29bf-90b1-e49a-6cf9-069c59bc1067@2ndQuadrant.com> <40FDB1F3-932D-4912-B4C7-F1E26E331079@justatheory.com> <7ca5214d-f981-54e4-c65a-470a87aa665e@2ndQuad! ! ! rant.com> <1090.1506365074@sss.pgh.pa.us> <9666.1506446327@sss.pgh.pa.us> <329.1506451066@sss.pgh.pa.us> Message-ID: <38835cdd-c378-8d7a-013b-fd733c78c649@2ndQuadrant.com> Date: Tue, 26 Sep 2017 15:33:03 -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: <329.1506451066@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-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On 09/26/2017 02:37 PM, Tom Lane wrote: > I wrote: >> Pushed; sorry for the delay. > ... and the buildfarm's not too happy. It looks like force_parallel_mode > breaks all the regression test cases around unsafe enums; which on > reflection is unsurprising, because parallel workers will not have access > to the parent's blacklist hash, so they will think unsafe values are safe. > > Now, as long as parallel workers are read-only, perhaps this matters > little; they would not be allowed to write unsafe values into tables > anyway. I'm concerned though about whether it might be possible for a > parallel worker to return an unsafe value to the parent (in OID form) > and then the parent writes it into a table. If we can convince ourselves > that's not possible, it might be okay to just turn off force_parallel_mode > for these test cases. > > A safer answer would be to mark enum_in() and other callers of > check_safe_enum_use() as parallel-restricted. That'd require a > post-RC1 catversion bump, which seems pretty unpleasant, but > none of the other answers are nice either. > > Transmitting the blacklist hash to workers would be a good long-term > answer, but I don't want to try to shoehorn it in for v10. > > Another idea is that maybe the existence of a blacklist hash should > be enough to turn off parallel mode altogether ... but ugh. > > Or maybe we're back to "revert the whole feature, go back to 9.6 > behavior". > > Thoughts? I think I would mark enum_in and friends as parallel-restricted. Yes I know it would involve a cat version bump, so I'll understand if that's not acceptable, but it seems to me the best of a bad bunch of choices. Second choice might be turning off parallel mode if the hash exists, but I'm unclear how that would work. cheers andrew -- Andrew Dunstan https://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs