From: | M Sarwar <sarwarmd02(at)outlook(dot)com> |
---|---|
To: | "Hajek, Nick" <Nick(dot)Hajek(at)vishay(dot)com>, "Campbell, Lance" <lance(at)illinois(dot)edu>, "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org> |
Subject: | Re: Enhancement Request |
Date: | 2024-01-31 20:55:34 |
Message-ID: | DM4PR19MB597863302D9DE35498BC4CA7D37C2@DM4PR19MB5978.namprd19.prod.outlook.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
If they allow DELETE FROM-LIMT to work, it is going to harm the general interest of the database.
In my opinion, that should not be implemented.
Thanks,
Sarwar
________________________________
From: Hajek, Nick <Nick(dot)Hajek(at)vishay(dot)com>
Sent: Wednesday, January 31, 2024 3:50 PM
To: M Sarwar <sarwarmd02(at)outlook(dot)com>; Campbell, Lance <lance(at)illinois(dot)edu>; pgsql-admin(at)postgresql(dot)org <pgsql-admin(at)postgresql(dot)org>
Subject: RE: Enhancement Request
[ External Email ]
// Are you confirming that DELETE FROM - LIMIT is working?
No, I don’t believe you can use limit in the delete itself but you can use it in a subselect and accomplish the same thing as shown in the example below.
// It would be nice if the DELETE FROM supported LIMIT. I can already feel the dislike for this post coming back in my direction.
// I have had numerous times over the years where I need to delete a lot of rows from a table but because each row is linked to so many other tables it will cause // a problem in performance if I don’t limit the size of the deletion.
I use a query like this to accomplish a limited deletion –
Delete from table1 where table1.id in (select table1.id from table1 limit yourlimitnumber)
From | Date | Subject | |
---|---|---|---|
Next Message | Ron Johnson | 2024-02-01 01:31:30 | Re: Enhancement Request |
Previous Message | Hajek, Nick | 2024-01-31 20:50:48 | RE: Enhancement Request |