From: MichaelDBA <MichaelDBA@sqlexec.com>
To: Campbell, Lance <lance@illinois.edu>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: Enhancement Request
Date: Wed, 31 Jan 2024 14:32:15 -0500
Message-ID: <e9c5720a-6d8e-67ae-f20f-3f13bf99058f@sqlexec.com> (raw)
In-Reply-To: <SJ0PR11MB56294F4A249D780BC3A18330DE7C2@SJ0PR11MB5629.namprd11.prod.outlook.com>
References: <SJ0PR11MB56294F4A249D780BC3A18330DE7C2@SJ0PR11MB5629.namprd11.prod.outlook.com>
Cheat a bit....
Use a CTE with a limit on the select and then delete everything from the
CTE.
Campbell, Lance wrote on 1/31/2024 2:29 PM:
>
> 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.
>
> Just throwing this out there.
>
> Thanks,
>
> Lance
>
Regards,
Michael Vitale
Michaeldba@sqlexec.com <mailto:michaelvitale@sqlexec.com>
703-600-9343
Attachments:pgadvanced3.jpg (image/jpeg, 20.6K) downloadview image
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: MichaelDBA@sqlexec.com, lance@illinois.edu
Subject: Re: Enhancement Request
In-Reply-To: <e9c5720a-6d8e-67ae-f20f-3f13bf99058f@sqlexec.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox