X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 7644AD82C0 for ; Fri, 18 Nov 2005 20:06:22 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 10242-09 for ; Sat, 19 Nov 2005 00:06:24 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id C847FD6D50 for ; Fri, 18 Nov 2005 20:06:19 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id jAJ06LXL013281; Fri, 18 Nov 2005 19:06:21 -0500 (EST) To: "Virag Saksena" cc: pgsql-performance@postgresql.org Subject: Re: ERROR: no value found for parameter 1 with JDBC and Explain Analyze In-reply-to: References: Comments: In-reply-to "Virag Saksena" message dated "Tue, 15 Nov 2005 10:06:33 +0000" Date: Fri, 18 Nov 2005 19:06:20 -0500 Message-ID: <13280.1132358780@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.005 required=5 tests=[AWL=0.005] X-Spam-Score: 0.005 X-Spam-Level: X-Archive-Number: 200511/387 X-Sequence-Number: 15644 "Virag Saksena" writes: > ERROR: no value found for parameter 1 > Here is sample code which causes this exception ... > pst=prodconn.prepareStatement("explain analyze select count(*) from > jam_heaprel r where heap_id = ? and parentaddr = ?"); I don't think EXPLAIN can take parameters (most of the "utility" statements don't take parameters). The usual workaround is to use PREPARE: PREPARE foo(paramtype,paramtype) AS SELECT ...; EXPLAIN EXECUTE foo(x,y); This will generate the same parameterized plan as you'd get from the other way, so it's a reasonable approximation to the behavior with JDBC parameters. regards, tom lane