Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WiOr7-0005sK-Ms for pgsql-general@arkaria.postgresql.org; Thu, 08 May 2014 13:59:25 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WiOr6-0006uf-VP for pgsql-general@arkaria.postgresql.org; Thu, 08 May 2014 13:59:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WiOr5-0006uS-L0; Thu, 08 May 2014 13:59:23 +0000 Received: from gw.crysberg.dk ([194.239.152.65] helo=mail.crysberg.dk) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WiOr1-0007Zw-IL; Thu, 08 May 2014 13:59:23 +0000 Received: from quick.crysberg.dk (quick.crysberg.dk [192.168.10.139]) by mail.crysberg.dk (8.14.3/8.12.10) with ESMTP id s48DxFGc008073; Thu, 8 May 2014 15:59:15 +0200 Received: from localhost (localhost [127.0.0.1]) by quick.crysberg.dk (Postfix) with ESMTP id CB0C6F00B9; Thu, 8 May 2014 15:59:14 +0200 (CEST) X-Virus-Scanned: amavisd-new at quick.crysberg.dk Received: from quick.crysberg.dk ([127.0.0.1]) by localhost (quick.crysberg.dk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KJkmxv5BROZL; Thu, 8 May 2014 15:59:09 +0200 (CEST) Received: from quick.crysberg.dk (quick.crysberg.dk [192.168.10.139]) by quick.crysberg.dk (Postfix) with ESMTP id 4FCFEF00B8; Thu, 8 May 2014 15:59:09 +0200 (CEST) Date: Thu, 8 May 2014 15:59:09 +0200 (CEST) From: Leif Jensen To: Tom Lane Cc: Adrian Klaver , pgsql-general , pgsql-bugs@postgresql.org Message-ID: <7070852.11378.1399557549199.JavaMail.root@quick> In-Reply-To: <31796.1399484383@sss.pgh.pa.us> Subject: Re: Server process crash - Segmentation fault MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Mailer: Zimbra 6.0.9_GA_2686 (ZimbraWebClient - FF3.0 (Linux)/6.0.9_GA_2686) X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org Hi Tom, I already compiled postgreSQL myself and now using 9.3.4, so I would very much like a patch. Where can I find that ? Leif ----- Original Message ----- > Leif Jensen writes: > > Could it be related to the OFFSET part of the statement ? I have > > another query on the same table without OFFSET, which seems to > > work fine. > > Yeah, the specific code path here involves executing a stable (or > possibly > immutable) SQL function in a LIMIT or OFFSET clause. I was able to > reproduce the crash like so: > > create function foo(int) returns int as 'select $1 limit 1' > language sql stable; > > begin; > > declare c cursor for select * from int8_tbl limit foo(3); > > select * from c; > > move backward all in c; > > select * from c; > > commit; > > You might be able to dodge the problem if you can make the SQL > function > inline-able (the LIMIT 1 in my example is just to prevent that from > happening). A less appealing alternative is to mark the function > VOLATILE, which I think would also prevent this crash, but might have > negative performance consequences. > > If you don't mind building your own PG then you could grab the actual > fix > from our git repo; I should have something committed before long. > > regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general