Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 3728C64FEBD for ; Wed, 3 Dec 2008 08:08:21 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 55294-04 for ; Wed, 3 Dec 2008 08:08:19 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sd-9404.dedibox.fr (sd-9404.dedibox.fr [88.191.51.144]) by mail.postgresql.org (Postfix) with ESMTP id 2819764FE25 for ; Wed, 3 Dec 2008 08:08:18 -0400 (AST) Received: by sd-9404.dedibox.fr (Postfix, from userid 1002) id 49E7DE84004; Wed, 3 Dec 2008 13:08:15 +0100 (CET) Content-Type: text/plain; charset="iso-8859-15"; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-Mailer: Manitou v0.9.11 From: "Daniel Verite" Subject: Re: deallocating prepared statements To: pgsql-interfaces@postgresql.org In-Reply-To: <9D29FD18CBD74A478CBA86E6EF6DBAD402FF8CC9@CHI4EVS04.corp.transunion.com> Date: Wed, 03 Dec 2008 12:29:05 +0100 Message-ID: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200812/2 X-Sequence-Number: 6819 Haszlakiewicz, Eric wrote: > So, instead I tried using the libpq interface: > > struct connection *ecpg_conn = ECPGget_connection(NULL); > PGconn *conn = ecpg_conn->connection; > Oid deallocTypes[] = { VARCHAROID }; > const char *deallocValues[] = { stmtName }; > int deallocLengths[] = { strlen(stmtName) } ; > int deallocFormats[] = { 0 } ; > > PGresult *dealloc_result; > dealloc_result = PQexecParams(conn, "DEALLOCATE $1", 1, deallocTypes, > deallocValues, deallocLengths, deallocFormats, 1); > > But I get this error: > syntax error at or near "$1" at character 12 The prepared statement's name is not a literal, and in general parameterized queries don't accept parameters beyond literals. So you need to insert the name directly into the SQL command text. Best regards, -- Daniel PostgreSQL-powered mail user agent and storage: http://www.manitou-mail.org