From: | Rajni Bobal <rajnibobal(at)gmail(dot)com> |
---|---|
To: | rajnibobal(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-01-16 10:50:14 |
Message-ID: | CA+UiKXa4Gk4r1a-ZD4rrMsigxM=LTdnTmxDZCg8WV7avHGPPKA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
Hello Sir/Team,
I have created a new bug report, #18776, with the updated problem
statement. Kindly disregard bug #18774. Apologies for any inconvenience
caused.
regards,
RAJNI BOBAL
On Thu, Jan 16, 2025 at 12:59 PM PG Bug reporting form <
noreply(at)postgresql(dot)org> wrote:
> The following bug has been logged on the website:
>
> Bug reference: 18774
> Logged by: Rajni Bobal
> Email address: rajnibobal(at)gmail(dot)com
> PostgreSQL version: Unsupported/Unknown
> Operating system: Ubuntu 22
> Description:
>
> The output or behavior of the query used in the
> function(delete_from_table1)
> below is not producing the expected results, while
> function(delete_from_table2) with its query produces the expected result
> when used. ( Means all the data is deleted by the function
> delete_from_table1, while data (based on wherecon condition) is deleted by
> the function delete_from_table2.)
>
> CREATE OR REPLACE FUNCTION delete_from_table1(tblname text, sel_tblname
> text, wherecon text, colname text, batchsize int)
> RETURNS void AS
> $$
> BEGIN
> -- Construct dynamic SQL for DELETE
> EXECUTE 'DELETE FROM '
> || quote_ident(tblname)
> || ' WHERE '
> || quote_ident(colname)
> || ' IN (SELECT '
> || quote_ident(colname)
> || ' FROM '
> || quote_ident(sel_tblname)
> || ' WHERE '
> || wherecon
> || ' LIMIT '
> || batchsize || ')';
> END;
> $$ LANGUAGE plpgsql;
>
>
> CREATE OR REPLACE FUNCTION delete_from_table2(tblname text, sel_tblname
> text, wherecon text, colname text, batchsize int)
> RETURNS void AS
> $$
> BEGIN
> EXECUTE 'DELETE from ' || quote_ident(tblname) ||
> ' where $1 in (select $1 from ' || quote_ident(sel_tblname) ||
> ' where ' || wherecon || ' limit $2 ) '
> USING colname, batchsize;
> END;
> $$ LANGUAGE plpgsql;
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Vik Fearing | 2025-01-16 14:55:25 | Re: BUG #18774: Not the required output of the query used in the function(delete_from_table1) in postgresql9.4 |
Previous Message | PG Bug reporting form | 2025-01-16 09:29:17 | BUG #18775: PQgetCopyData always has an out-of-memory error if the table field stores bytea ~700 MB |