Re: How to implement a dynamic string into a sql statement? - Mailing list pgsql-jdbc

From Craig Ringer
Subject Re: How to implement a dynamic string into a sql statement?
Date
Msg-id 53FD969E.6040208@2ndquadrant.com
Whole thread Raw
In response to Re: How to implement a dynamic string into a sql statement?  (David G Johnston <david.g.johnston@gmail.com>)
List pgsql-jdbc
On 08/27/2014 02:26 AM, David G Johnston wrote:
> Lussier, Denis wrote
>> Don't use prepared statements for DDL.
>
> Parameters only handle values, not identifiers.  DDL deals exclusively with
> identifiers.

Actually, that isn't strictly true, there are plenty of places where DDL
takes literals.

The fundamental difference is that anything going through ProcessUtility
isn't subject to parameter expansion and cannot be prepared with
parameters. Only plannable statements can have server-side parameters.

PgJDBC can still, if it chooses, perform client-side parameter
substitution on DDL, though.

--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


pgsql-jdbc by date:

Previous
From: JasmineLiu
Date:
Subject: Re: invalid byte sequence for encoding "UTF8": 0x00
Next
From: Albe Laurenz
Date:
Subject: Re: invalid byte sequence for encoding "UTF8": 0x00