Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TypZ7-00033e-16 for pgsql-bugs@arkaria.postgresql.org; Fri, 25 Jan 2013 20:07:57 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TypZ6-0007hI-39 for pgsql-bugs@arkaria.postgresql.org; Fri, 25 Jan 2013 20:07:56 +0000 Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TypZ5-0007hD-Fg for pgsql-bugs@postgresql.org; Fri, 25 Jan 2013 20:07:55 +0000 Received: from moutng.kundenserver.de ([212.227.126.186]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TypZ3-0005cg-Jd for pgsql-bugs@postgresql.org; Fri, 25 Jan 2013 20:07:55 +0000 Received: from anarazel.de (p5DDC4573.dip.t-dialin.net [93.220.69.115]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0Lio0b-1UbTIj34ZR-00ccPA; Fri, 25 Jan 2013 21:07:52 +0100 Received: by anarazel.de (Postfix, from userid 1000) id 75A811C0177; Fri, 25 Jan 2013 21:07:51 +0100 (CET) Date: Fri, 25 Jan 2013 21:07:51 +0100 From: Andres Freund To: Tom Lane Cc: Sandro Santilli , pgsql-bugs@postgresql.org, peter_e@gmx.net Subject: Re: cache lookup failed from empty plpythonu function Message-ID: <20130125200751.GA27601@awork2.anarazel.de> References: <20130124140336.GJ3157@gnash> <20130124141751.GB21296@awork2.anarazel.de> <19721.1359045633@sss.pgh.pa.us> <20130125132025.GD4289@awork2.anarazel.de> <1566.1359143499@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1566.1359143499@sss.pgh.pa.us> X-Provags-ID: V02:K0:U6ZkBycU//HsNbzUbjz7/nuhuPO/jPZdPq6sln0xsku 9UvV4fkMFCXnMkGHDQJjuuBI/e4WxV9eyn5TI5FE+GmuVjSDdB fe79j9VVItaSd6iy9EHAxHQO1iumEJrsdjbHabuuuja6TGENll SuUyhA8OtnXgEEcLaUnBf4QiM911DBsVZ0TSXe/cOLj2gcVDor XptkCzStOwcc0WkdBwals2vx9zPVl5M96ywN9GccH2LkQAJh+z pTLW2z5y2877ui6zKtUvP/BnhXr//xFPHNbx8RqgFYvlh/TriU Zfd4TuK/3qU6J7K9AMUOnPowy8F1Vg980LDr6SAoJ13rePBLVm /iSkN9v5OBRKOPYugxyGAhEUGPBHov8HreHGZx+bC 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 On 2013-01-25 14:51:39 -0500, Tom Lane wrote: > Andres Freund writes: > > Its slightly more complex than just making it one hash table with an > > extended key. When validating a trigger function we don't have a > > relation to do the cache lookup. I chose to handle that case by not > > doing a cache lookup at all in that case which imo is a sensible > > choice. > > Seems fair. However ... why is it safe for PLy_procedure_create to be > using the same name for multiple instances of a trigger function? > Should we not be including the rel OID when building the procName > string? I don't think its a problem, given the way python works I am pretty sure it will result in independent functions. Each PLy_procedure_compile will run the source code in a copy of PLy_interp_globals, therefore the independent comilitions shouldn't affect each other. I am not sure why it builds the call to the function via eval'ing a "$funcname()" instead of using the result of PyRun_String which will return a reference to the function, but thats an independent issue. Now I think an argument can be made that it would be nicer for debugging purposes to have clearly distinguishable function names, but I personally never needed it and it probably wouldn't be something to backpatch. People might rely on those function names. Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, 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