Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 865C59FC139 for ; Fri, 11 May 2007 05:23:17 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 07322-04 for ; Fri, 11 May 2007 05:23:14 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from gmp-ea-fw-1.sun.com (gmp-ea-fw-1.sun.com [192.18.1.36]) by postgresql.org (Postfix) with ESMTP id 18A0E9FC0FF for ; Fri, 11 May 2007 05:23:13 -0300 (ADT) Received: from d1-emea-09.sun.com ([192.18.2.119]) by gmp-ea-fw-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id l4B8NCDu010204 for ; Fri, 11 May 2007 08:23:12 GMT Received: from conversion-daemon.d1-emea-09.sun.com by d1-emea-09.sun.com (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) id <0JHV00A01B6FRA00@d1-emea-09.sun.com> (original mail from Zdenek.Kotala@Sun.COM) for pgsql-hackers@postgresql.org; Fri, 11 May 2007 09:23:12 +0100 (BST) Received: from [192.168.2.2] ([89.103.141.233]) by d1-emea-09.sun.com (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPSA id <0JHV005IMBAJWQU3@d1-emea-09.sun.com> for pgsql-hackers@postgresql.org; Fri, 11 May 2007 09:23:08 +0100 (BST) Date: Fri, 11 May 2007 10:23:05 +0200 From: Zdenek Kotala Subject: race condition in pgplsql call handler? To: PostgreSQL-development Message-id: <464427E9.6030101@sun.com> MIME-version: 1.0 Content-type: text/plain; format=flowed; charset=ISO-8859-1 Content-transfer-encoding: 7BIT User-Agent: Thunderbird 1.5.0.8 (X11/20061204) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/463 X-Sequence-Number: 103065 I'm looking into PG/PLSql code and following code in plpgsql_call_handler looks strange: /* Find or compile the function */ func = plpgsql_compile(fcinfo, false); /* Mark the function as busy, so it can't be deleted from under us */ func->use_count++; I don't have deep knowledge about this part of code. But what happen if in parallel execution "func" will be deleted between these two lines? Zdenek