Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 49F602E0044 for ; Fri, 23 Nov 2007 07:46:36 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 55070-10 for ; Fri, 23 Nov 2007 07:46:31 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by postgresql.org (Postfix) with ESMTP id DB3A82E0043 for ; Fri, 23 Nov 2007 07:46:35 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.14.1/8.14.1) with ESMTP id lANBkVTr003902 for ; Fri, 23 Nov 2007 07:46:31 -0400 (AST) (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.14.1/8.14.1/Submit) id lANBghm8002263 for pgsql-sql@postgresql.org; Fri, 23 Nov 2007 07:42:43 -0400 (AST) (envelope-from news) From: "Sabin Coanda" X-Newsgroups: pgsql.sql Subject: Re: Aleatory exception - found cause Date: Fri, 23 Nov 2007 13:42:50 +0200 Organization: Hub.Org Networking Services Lines: 20 Message-ID: References: X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-RFC2646: Format=Flowed; Response To: pgsql-sql@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/126 X-Sequence-Number: 29654 Hi, Finally I found the cause of the problem. I found deeper inside my calls, a function which has to return an integer column from a RECORD rec variable. The rec is assigned with the following statement: EXECUTE 'SELECT pk AS "PK" FROM "my_table" WHERE my_where_clause' INTO rec. When my_where_clause is not fulfilled, rec is initialized somehow with null. The exception is rised at the end where I call: RETURN rec."PK" Maybe someone can explain this behavior. TIA, Sabin