Re: Postgresql 9.5 and Shell scripts/variables vs. C programming/defining a value to be used

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Poul Kristensen <bcc5226(at)gmail(dot)com>, John McKown <john(dot)archie(dot)mckown(at)gmail(dot)com>, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Postgresql 9.5 and Shell scripts/variables vs. C programming/defining a value to be used
Date: 2016-11-23 15:44:14
Message-ID: 28320.1479915854@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> On Wed, Nov 23, 2016 at 3:46 AM, Poul Kristensen <bcc5226(at)gmail(dot)com> wrote:
>> In the postgresql.log I get "select datname from $1".

> ​That is expected when you parameterize a query - the query string includes
> parameter​s instead of values.

It looks like Poul is hoping to use a parameter as a table name,
which doesn't work. Parameters can only represent values (constants).

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2016-11-23 15:59:45 Re: [SPAM] Re: Best practices to manage custom statistics
Previous Message David G. Johnston 2016-11-23 15:25:38 Re: Postgresql 9.5 and Shell scripts/variables vs. C programming/defining a value to be used