From: Tom Lane <tgl@sss.pgh.pa.us>
To: Virag Saksena <v_saks@hotmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: ERROR: no value found for parameter 1 with JDBC and Explain Analyze
Date: Fri, 18 Nov 2005 19:06:20 -0500
Message-ID: <13280.1132358780@sss.pgh.pa.us> (raw)
In-Reply-To: <BAY103-F11ECB17126271926CB8DE1EC5D0@phx.gbl>
References: <BAY103-F11ECB17126271926CB8DE1EC5D0@phx.gbl>
"Virag Saksena" <v_saks@hotmail.com> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, v_saks@hotmail.com
Subject: Re: ERROR: no value found for parameter 1 with JDBC and Explain Analyze
In-Reply-To: <13280.1132358780@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox