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

From: Rajni Bobal <rajnibobal(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: 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 05:37:25
Message-ID: CA+UiKXZ1tYpE5Nm5bd_vP2pQ9j3RBDXYkU0cZCPeuqGaQV02pA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hello Sir,

Thanks for the reply,

as per the documentation, following query execute successfully :

EXECUTE 'SELECT count(*) FROM '
|| quote_ident(tabname)
|| ' WHERE inserted_by = $1 AND inserted <= $2'
INTO c
USING checked_user, checked_date;

HERE, $1 and $2 are strings and its values are substituted in the
query. Please clarify, may be i am missing something.

Regards,

Rajni Bobal

On Thu, Jan 23, 2025 at 7:54 PM David G. Johnston <
david(dot)g(dot)johnston(at)gmail(dot)com> wrote:

> On Thursday, January 23, 2025, Rajni Bobal <rajnibobal(at)gmail(dot)com> wrote:
>
>> Hello SIr,
>> Please clarify about why $1 is not been replaced by 'colname' in delete_from_table2
>> function.
>>
>
> It has been replace with the string literal value ‘colname’, not a column
> reference identifier “colname”. You cannot use positional parameters to
> supply identifiers. Structure must be known at parse time.
>
> David J.
>
>

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next 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
Previous Message Rajni Bobal 2025-02-03 05:32:18 Re: BUG #18774: Not the required output of the query used in the function(delete_from_table1) in postgresql9.4