Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XSM5t-0006V5-UN for pgsql-bugs@arkaria.postgresql.org; Fri, 12 Sep 2014 08:20:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XSM5s-0001hn-QH for pgsql-bugs@arkaria.postgresql.org; Fri, 12 Sep 2014 08:20:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XSM5r-0001hd-Ql for pgsql-bugs@postgresql.org; Fri, 12 Sep 2014 08:20:35 +0000 Received: from mail-la0-f50.google.com ([209.85.215.50]) by magus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1XSM5o-0000VJ-3d for pgsql-bugs@postgresql.org; Fri, 12 Sep 2014 08:20:34 +0000 Received: by mail-la0-f50.google.com with SMTP id ty20so464362lab.9 for ; Fri, 12 Sep 2014 01:20:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=5q5LLQmWxDOf8gAKZn6OQ1w1V6X85ObvLqHx7tPs5Mc=; b=YX3B+nr7+xuczhqEryCyeMPFT6ZcgSViw8QwbaV8G8bSHyeSFJtROHVfvpVEQtuZOL kHvwJRJ9oaaXuj82xkbdBgzB6f01o/l7NRtLtU2Hn/DhOeTxD0u1aWHKOJlJSUliD9I9 c1TH3gv5DX0sCaVRMaWPp6DVPV53ASYmJs8d8hTuPdIKOyTBbl6aOe4CVSnRBQmH8YOj 5pGqCYfUS0AFwZ8bRmFYmV0SUpD/GnkwDkSIMqpiT12LX2gkOXbbr4ovxvbKEAJGjL8s DexRwbHE1efJXKdrW7YS0AaDYKmrR7Lef4kYMohdLeCQ8buq+n7ChzeOrCUX9nvfNeBw nSCw== X-Gm-Message-State: ALoCoQlp2yGX+6Yhyo9SVob2/0zWArRbtDw9mDxFfrxEmh+NGNzzmoqj7Ip+u5eNlkyNB6Dlwjy2 X-Received: by 10.152.21.195 with SMTP id x3mr7009486lae.11.1410510030365; Fri, 12 Sep 2014 01:20:30 -0700 (PDT) Received: from dalli.local (c-5eeaaa28-74736162.cust.telenor.se. [94.234.170.40]) by mx.google.com with ESMTPSA id or5sm678355lbb.42.2014.09.12.01.20.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 12 Sep 2014 01:20:29 -0700 (PDT) Message-ID: <5412ACCD.8090609@joh.to> Date: Fri, 12 Sep 2014 10:20:29 +0200 From: Marko Tiikkaja User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Tom Lane CC: pgsql-bugs@postgresql.org Subject: Re: BUG #11402: Prepared statement cache invalidation and unknown types References: <20140911215805.2484.10673@wrigleys.postgresql.org> <29786.1410486915@sss.pgh.pa.us> In-Reply-To: <29786.1410486915@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 9/12/14, 3:55 AM, Tom Lane wrote: > marko@joh.to writes: >> I hit the behaviour on 9.1 originally with functions, but tested it against >> a reasonably fresh HEAD and it was still broken. Somehow it seems that the >> prepared statement isn't willing to forget the data type of the argument >> after it has been resolved once (even though it was specified to be unknown >> :-( ). This leads to some grotesque cache invalidation code in our API. > > I'm not exactly convinced that this is a bug. Having a prepared statement > silently change its input parameter types seems a lot more dangerous than > just failing; especially since we lack any signaling mechanism by which > the client application could be warned that whatever it may have known > about the statement is now invalid. Yeah, that's probably fair. I guess it's possible for an app to use unknown type parameters and then ask the database about the data types and do something different based on that. I'll just have to live with the (increasingly) horrible logic. Thanks for your reply. .marko -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs