Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WGzks-0000UY-OW for pgsql-bugs@arkaria.postgresql.org; Fri, 21 Feb 2014 23:43:42 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WGzks-0005hb-72 for pgsql-bugs@arkaria.postgresql.org; Fri, 21 Feb 2014 23:43:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WGzkq-0005hM-Vd for pgsql-bugs@postgresql.org; Fri, 21 Feb 2014 23:43:41 +0000 Received: from mail-qc0-f176.google.com ([209.85.216.176]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WGzkm-0002mI-Py for pgsql-bugs@postgresql.org; Fri, 21 Feb 2014 23:43:39 +0000 Received: by mail-qc0-f176.google.com with SMTP id r5so2120635qcx.21 for ; Fri, 21 Feb 2014 15:43:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=6PBorAzybEavqBfYxvMzbWpvErBvmlkRVXZO6USP6Es=; b=h6qp1BW3z5JSXPTPSloUueQnQaK5pwOmTT+AhDj6m1NZua1TdRilYvegTUe7AY2Jc7 uoVojE2aT8b68Mx81A8Lal3yWLXppWWo572myGhiJa4DsISjwc5JAurpygvyaWJRznu6 xApmNnlWXEQpUcKuWpK7p9bRhBP6btrqQEbRk+aCiSKGfZrxoDTgfZEUvnegqANXvzC/ Wy/EnrQYcf3m+Iri0BjmAx7BcoqD5m1yrJui3q3RrKz7LCC4dg2ShnJRo25cl0rRdYNK AeBM5vshz/NJx3rKdObKGrzvQuYpRTS5r5drVjkNPiK/uvnN2j7iJWNvoFEgonOhgoM2 nsdw== X-Gm-Message-State: ALoCoQkBxU0IeKmAxpPVJ9HNcRSC4cc0Wvo+NBaKprJ4+G7lFxbpV9Ojmamk3SDC+LWX9nzxSLKg X-Received: by 10.140.29.38 with SMTP id a35mr13429546qga.55.1393026214863; Fri, 21 Feb 2014 15:43:34 -0800 (PST) Received: from tornado.leadboat.com (c-107-4-219-91.hsd1.va.comcast.net. [107.4.219.91]) by mx.google.com with ESMTPSA id i38sm14547380qge.1.2014.02.21.15.43.34 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 21 Feb 2014 15:43:34 -0800 (PST) Date: Fri, 21 Feb 2014 18:43:32 -0500 From: Noah Misch To: Tom Lane Cc: pgsql-bugs@postgresql.org, pgsql-hackers@postgresql.org, digoal@126.com Subject: Re: [HACKERS] Re: BUG #9210: PostgreSQL string store bug? not enforce check with correct characterSET/encoding Message-ID: <20140221234332.GB3088878@tornado.leadboat.com> References: <20140213140759.2710.49877@wrigleys.postgresql.org> <20127.1392324548@sss.pgh.pa.us> <12131.1392760137@sss.pgh.pa.us> <4385.1392859333@sss.pgh.pa.us> <20140220043940.GA3064539@tornado.leadboat.com> <19842.1393021206@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <19842.1393021206@sss.pgh.pa.us> User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -2.6 (--) 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 Fri, Feb 21, 2014 at 05:20:06PM -0500, Tom Lane wrote: > Noah Misch writes: > > On Wed, Feb 19, 2014 at 08:22:13PM -0500, Tom Lane wrote: > >> How much of this is back-patch material, do you think? > > > None of it. While many of the failures to validate against a character > > encoding are clear bugs, applications hum along in spite of such bugs and > > break when we tighten the checks. I don't see a concern to override that > > here. Folks who want the tighter checking have some workarounds available. > > That's certainly a reasonable position to take concerning the changes for > outside-a-transaction behavior. However, I think there's a case to be > made for adding the additional pg_verify_mbstr() calls in the back > branches. We've been promising since around 8.3 that invalidly encoded > data can't get into a database, and it's disturbing to find that there > are leaks in that. I had a dark corner of an app break from the 8.4-vintage change to make E'abc\000def'::text raise an error rather than truncate the string. The old behavior was clearly wrong, but I was still glad the change arrived in a major release; the truncation happened to be harmless for that app. Adding pg_verify_mbstr() calls creates a similar situation. Anything broken by the outside-a-transaction behavior change will be in C code. I'll expect between zero and one reports of breakage from that, so whether to back-patch that is more academic. -- Noah Misch EnterpriseDB http://www.enterprisedb.com -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs