Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 6F90F45232B; Wed, 4 Jan 2012 17:21:55 -0400 (AST) Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RiYHQ-0003Vw-96; Wed, 04 Jan 2012 21:21:55 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id q04LLblb022488; Wed, 4 Jan 2012 16:21:37 -0500 (EST) To: Paul Ramsey cc: Pgsql Hackers , pgsql-bugs@postgresql.org Subject: Re: BUG #6379: SQL Function Causes Back-end Crash In-reply-to: References: <20120104192524.GA8370@depesz.com> Comments: In-reply-to Paul Ramsey message dated "Wed, 04 Jan 2012 12:35:33 -0800" Date: Wed, 04 Jan 2012 16:21:37 -0500 Message-ID: <22487.1325712097@sss.pgh.pa.us> From: Tom Lane X-Pg-Spam-Score: -3.8 (---) X-Archive-Number: 201201/29 X-Sequence-Number: 32096 Paul Ramsey writes: > Further notes, from Andrew (RhodiumToad) on IRC about the cause of this crasher: > [12:31pm] RhodiumToad: there's no trivial fix IMO the main bug here is that functions.c isn't expecting qd->dest to be overwritten, so we could work around it by keeping a separate private copy of the dest pointer. However, it would also be fair to ask whether there's not a cleaner solution. Perhaps the intoRel stuff should be saving/restoring the original destreceiver instead of just blindly overwriting it. regards, tom lane