>
>
> On Wed, Jan 21, 2015 at 4:09 PM, Bryn Jeffries <
> bryn.jeffr...@sydney.edu.au> wrote:
>
>>
>> Maybe what we need in ODBC libs and the like is a "protected
>> statement" that follows the same construction as a prepared statement but
>> additionally checks catalogs to validate identifiers.
>>
On 01/21/2015 03:09 PM, Bryn Jeffries wrote:
Paul Jungwirth wrote
I'm not sure how to make a prepared statement that lets you name a
column when you execute it. Maybe someone else can chime in if that's
possible.
David J. responded
You cannot. By definition parameters, in this context, are v
On Wed, Jan 21, 2015 at 4:09 PM, Bryn Jeffries
wrote:
> Paul Jungwirth wrote
> > I'm not sure how to make a prepared statement that lets you name a
> > column when you execute it. Maybe someone else can chime in if that's
> > possible.
>
> David J. responded
> > You cannot. By definition paramet
Paul Jungwirth wrote
> I'm not sure how to make a prepared statement that lets you name a
> column when you execute it. Maybe someone else can chime in if that's
> possible.
David J. responded
> You cannot. By definition parameters, in this context, are values - not
> identifiers.
> [...]
> In
@postgresql.org"
Subject: [GENERAL] ORDER BY in prepared statements
Date: Thu, Jan 22, 2015 08:18
On 01/21/2015 12:51 PM, Bryn Jeffries wrote:
> In a number of places on the web I've seen it claimed that ordering can
> be set via prepared statements.
Can you give a link t
Paul Jungwirth wrote
>> In a number of places on the web I've seen it claimed that ordering can
>> be
>> set via prepared statements.
>> ...
>> sandbox=# PREPARE testplan(text) AS
>> SELECT * FROM test ORDER BY $1;
>>
>> But the output is not what one would expect:
>>
>> sandbox=# EXECUTE testplan(
On 01/21/2015 12:51 PM, Bryn Jeffries wrote:
In a number of places on the web I've seen it claimed that ordering can
be set via prepared statements.
Can you give a link to one of those examples?
Many thanks,
Bryn
--
Adrian Klaver
adrian.kla...@aklaver.com
--
Sent via pgsql-general mail
> In a number of places on the web I've seen it claimed that ordering can be
> set via prepared statements.
> ...
> sandbox=# PREPARE testplan(text) AS
> SELECT * FROM test ORDER BY $1;
>
> But the output is not what one would expect:
>
> sandbox=# EXECUTE testplan('gender');
> ...
> As opposed to:
In a number of places on the web I've seen it claimed that ordering can be set
via prepared statements. Indeed, the expected syntax is accepted on my 9.3
server without errors:
sandbox=# CREATE TABLE test (
id serial PRIMARY KEY,
gender char
);
sandbox=# INSERT INTO test(gender) VALUES('m') VA