Re: BUG #18774: Not the required output of the query used in the function(delete_from_table1) in postgresql9.4

From: Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Rajni Bobal <rajnibobal(at)gmail(dot)com>
Cc: Greg Sabino Mullane <htamfids(at)gmail(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18774: Not the required output of the query used in the function(delete_from_table1) in postgresql9.4
Date: 2025-02-03 11:10:51
Message-ID: 202502031110.zwixdecgonww@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 2025-Feb-03, Rajni Bobal wrote:

> Please clarify the use of %I will not be substituted by the string literal
> 'colname' rather its value will be substituted dynamically.

Yes, it is expanded dynamically to the _value_ of the variable
colname, not to the literal 'colname'. If you wanted to expand a
string literal there, you would use something like

SELECT format('some text .. %I ... more', 'colname');

--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Chris BSomething 2025-02-03 12:29:57 Re: Bug in psql
Previous Message David G. Johnston 2025-02-03 05:50:56 Re: BUG #18774: Not the required output of the query used in the function(delete_from_table1) in postgresql9.4