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

From Álvaro Herrera
Subject Re: BUG #18774: Not the required output of the query used in the function(delete_from_table1) in postgresql9.4
Date
Msg-id 202502031110.zwixdecgonww@alvherre.pgsql
Whole thread Raw
In response to Re: BUG #18774: Not the required output of the query used in the function(delete_from_table1) in postgresql9.4  (Rajni Bobal <rajnibobal@gmail.com>)
List 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/



pgsql-bugs by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: BUG #18774: Not the required output of the query used in the function(delete_from_table1) in postgresql9.4
Next
From: Chris BSomething
Date:
Subject: Re: Bug in psql