Re: [Proposal] vacuumdb --schema only

2022-07-31 Thread Andrew Dunstan
On 2022-04-26 Tu 00:46, Nathan Bossart wrote: > On Tue, Apr 26, 2022 at 11:36:02AM +0900, Michael Paquier wrote: >> The refactoring logic to build the queries is clear to follow. I have >> a few comments about the shape of the patch, though. > Thanks for taking a look! > >> case 'a':

Re: [Proposal] vacuumdb --schema only

2022-04-25 Thread Nathan Bossart
On Tue, Apr 26, 2022 at 11:36:02AM +0900, Michael Paquier wrote: > The refactoring logic to build the queries is clear to follow. I have > a few comments about the shape of the patch, though. Thanks for taking a look! > case 'a': > - alldb = true; > + chec

Re: [Proposal] vacuumdb --schema only

2022-04-25 Thread Michael Paquier
On Mon, Apr 25, 2022 at 09:18:53AM -0700, Nathan Bossart wrote: > I've marked it as ready-for-committer. The refactoring logic to build the queries is clear to follow. I have a few comments about the shape of the patch, though. case 'a': - alldb = true; +

Re: [Proposal] vacuumdb --schema only

2022-04-25 Thread Nathan Bossart
On Mon, Apr 25, 2022 at 08:50:09AM +0200, Gilles Darold wrote: > Can I change the commitfest status to ready for committers? I've marked it as ready-for-committer. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com

Re: [Proposal] vacuumdb --schema only

2022-04-24 Thread Gilles Darold
goo Le 25/04/2022 à 03:27, Nathan Bossart a écrit : > On Fri, Apr 22, 2022 at 10:57:46PM -0700, Nathan Bossart wrote: >> On Fri, Apr 22, 2022 at 11:57:05AM +0200, Gilles Darold wrote: >>> Patch v10 attached. >> Thanks! I've attached a v11 with some minor editorialization. I think I >> was able to

Re: [Proposal] vacuumdb --schema only

2022-04-24 Thread Nathan Bossart
On Fri, Apr 22, 2022 at 10:57:46PM -0700, Nathan Bossart wrote: > On Fri, Apr 22, 2022 at 11:57:05AM +0200, Gilles Darold wrote: >> Patch v10 attached. > > Thanks! I've attached a v11 with some minor editorialization. I think I > was able to improve the error handling for invalid combinations of

Re: [Proposal] vacuumdb --schema only

2022-04-22 Thread Nathan Bossart
On Fri, Apr 22, 2022 at 11:57:05AM +0200, Gilles Darold wrote: > Patch v10 attached. Thanks! I've attached a v11 with some minor editorialization. I think I was able to improve the error handling for invalid combinations of command-line options a bit, but please let me know what you think. --

Re: [Proposal] vacuumdb --schema only

2022-04-22 Thread Gilles Darold
Le 20/04/2022 à 19:38, Nathan Bossart a écrit : Thanks for the new patch! I think this is on the right track. On Wed, Apr 20, 2022 at 05:15:02PM +0200, Gilles Darold wrote: Le 18/04/2022 à 23:56, Nathan Bossart a écrit : - if (!tables_listed) + if (!objects_listed || objfilter ==

Re: [Proposal] vacuumdb --schema only

2022-04-20 Thread Nathan Bossart
On Wed, Apr 20, 2022 at 12:40:52PM -0500, Justin Pryzby wrote: > On Wed, Apr 20, 2022 at 10:38:46AM -0700, Nathan Bossart wrote: >> Furthermore, do you think it'd be possible to dynamically generate the >> message? > > Not in the obvious way, because that breaks translatability. Ah, right. -- N

Re: [Proposal] vacuumdb --schema only

2022-04-20 Thread Justin Pryzby
On Wed, Apr 20, 2022 at 10:38:46AM -0700, Nathan Bossart wrote: > > +void > > +check_objfilter(VacObjectFilter curr_objfilter, VacObjectFilter > > curr_option) > > +{ > > + switch (curr_option) > > + { > > + case OBJFILTER_NONE: > > + break; > > + case OBJ

Re: [Proposal] vacuumdb --schema only

2022-04-20 Thread Nathan Bossart
Thanks for the new patch! I think this is on the right track. On Wed, Apr 20, 2022 at 05:15:02PM +0200, Gilles Darold wrote: > Le 18/04/2022 à 23:56, Nathan Bossart a écrit : >> > - if (!tables_listed) >> > + if (!objects_listed || objfilter == OBJFILTER_SCHEMA) >> Do we need to check for objec

Re: [Proposal] vacuumdb --schema only

2022-04-20 Thread Gilles Darold
Le 18/04/2022 à 23:56, Nathan Bossart a écrit : On Thu, Apr 14, 2022 at 10:27:46PM +0200, Gilles Darold wrote: Attached v8 of the patch that tries to address the remarks above, fixes patch apply failure to master and replace calls to pg_log_error+exit with pg_fatal. Thanks for the new patch.

Re: [Proposal] vacuumdb --schema only

2022-04-18 Thread Nathan Bossart
On Thu, Apr 14, 2022 at 10:27:46PM +0200, Gilles Darold wrote: > Attached v8 of the patch that tries to address the remarks above, fixes > patch apply failure to master and replace calls to pg_log_error+exit > with pg_fatal. Thanks for the new patch. > +enum trivalue schema_is_exclude = TRI_DEFAU

Re: [Proposal] vacuumdb --schema only

2022-04-14 Thread Gilles Darold
Le 11/04/2022 à 20:37, Nathan Bossart a écrit : > On Fri, Apr 08, 2022 at 05:16:06PM +0200, Gilles Darold wrote: >> Attached v7 of the patch that should pass cfbot. > Thanks for the new patch! Unfortunately, it looks like some recent changes > have broken it again. > >> +enum trivalue schema_is_ex

Re: [Proposal] vacuumdb --schema only

2022-04-11 Thread Nathan Bossart
On Fri, Apr 08, 2022 at 05:16:06PM +0200, Gilles Darold wrote: > Attached v7 of the patch that should pass cfbot. Thanks for the new patch! Unfortunately, it looks like some recent changes have broken it again. > +enum trivalue schema_is_exclude = TRI_DEFAULT; > + > +/* > + * The kind of object

Re: [Proposal] vacuumdb --schema only

2022-04-08 Thread Gilles Darold
Le 08/04/2022 à 02:46, Justin Pryzby a écrit : On Wed, Apr 06, 2022 at 07:43:42PM +0200, Gilles Darold wrote: Thanks for the review, all these changes are available in new version v6 of the patch and attached here. This is failing in CI (except on macos, which is strangely passing). http://cfbo

Re: [Proposal] vacuumdb --schema only

2022-04-08 Thread Gilles Darold
Le 08/04/2022 à 02:46, Justin Pryzby a écrit : On Wed, Apr 06, 2022 at 07:43:42PM +0200, Gilles Darold wrote: Thanks for the review, all these changes are available in new version v6 of the patch and attached here. This is failing in CI (except on macos, which is strangely passing). http://cfbo

Re: [Proposal] vacuumdb --schema only

2022-04-07 Thread Justin Pryzby
On Wed, Apr 06, 2022 at 07:43:42PM +0200, Gilles Darold wrote: > Thanks for the review, all these changes are available in new version v6 > of the patch and attached here. This is failing in CI (except on macos, which is strangely passing). http://cfbot.cputube.org/gilles-darold.html https://api.

Re: [Proposal] vacuumdb --schema only

2022-04-06 Thread Gilles Darold
Le 30/03/2022 à 23:22, Nathan Bossart a écrit : > I took a look at the v4 patch. > > 'git-apply' complains about whitespace errors: Fixed. > + > +To clean all tables in the Foo and > bar schemas > +only in a database named xyzzy: > + > +$ vacuumdb --schema='"Foo"' --schema='bar' > x

Re: [Proposal] vacuumdb --schema only

2022-04-01 Thread Nathan Bossart
On Fri, Apr 01, 2022 at 10:01:28AM -0500, Justin Pryzby wrote: > On Wed, Mar 30, 2022 at 02:22:58PM -0700, Nathan Bossart wrote: >> I'm personally -1 for the --exclude-schema option. I don't see any >> existing "exclude" options in vacuumdb, and the uses for such an option >> seem rather limited.

Re: [Proposal] vacuumdb --schema only

2022-04-01 Thread Justin Pryzby
On Wed, Mar 30, 2022 at 02:22:58PM -0700, Nathan Bossart wrote: > I'm personally -1 for the --exclude-schema option. I don't see any > existing "exclude" options in vacuumdb, and the uses for such an option > seem rather limited. If we can point to specific use-cases for this > option, I might be

Re: [Proposal] vacuumdb --schema only

2022-03-30 Thread Nathan Bossart
I took a look at the v4 patch. 'git-apply' complains about whitespace errors: 0001-vacuumdb-schema-only-v4.patch:17: tab in indent. 0001-vacuumdb-schema-only-v4.patch:18: tab in indent. 0001-vacuumdb-schema-only-v4.patch:19: tab in

Re: [Proposal] vacuumdb --schema only

2022-03-10 Thread Robert Treat
On Thu, Mar 10, 2022 at 1:32 AM Gilles Darold wrote: > > Le 09/03/2022 à 22:10, Justin Pryzby a écrit : > > On Mon, Mar 07, 2022 at 08:38:04AM +0100, Gilles Darold wrote: > > Maybe it's clearer to write this with =ANY() / != ALL() ? > See 002. > > I have applied your changes and produced a new ver

Re: [Proposal] vacuumdb --schema only

2022-03-09 Thread Gilles Darold
Le 09/03/2022 à 22:10, Justin Pryzby a écrit : > On Mon, Mar 07, 2022 at 08:38:04AM +0100, Gilles Darold wrote: >>> Maybe it's clearer to write this with =ANY() / != ALL() ? >>> See 002. >> I have applied your changes and produced a new version v3 of the patch, >> thanks for the improvements. The p

Re: [Proposal] vacuumdb --schema only

2022-03-09 Thread Justin Pryzby
On Mon, Mar 07, 2022 at 08:38:04AM +0100, Gilles Darold wrote: > > Maybe it's clearer to write this with =ANY() / != ALL() ? > > See 002. > > I have applied your changes and produced a new version v3 of the patch, > thanks for the improvements. The patch have been added to commitfest > interface,

Re: [Proposal] vacuumdb --schema only

2022-03-09 Thread Gilles Darold
Hi, New version v4 of the patch to fix a typo in a comment. -- Gilles Darold diff --git a/doc/src/sgml/ref/vacuumdb.sgml b/doc/src/sgml/ref/vacuumdb.sgml index 956c0f01cb..378328afb3 100644 --- a/doc/src/sgml/ref/vacuumdb.sgml +++ b/doc/src/sgml/ref/vacuumdb.sgml @@ -39,6 +39,40 @@ PostgreSQL do

Re: [Proposal] vacuumdb --schema only

2022-03-06 Thread Gilles Darold
Le 06/03/2022 à 16:04, Justin Pryzby a écrit : > On Sun, Mar 06, 2022 at 09:39:37AM +0100, Gilles Darold wrote: >> Attached a new patch version that adds the -N | --exclude-schema option >> to the vacuumdb command as suggested. Documentation updated too. >> >> +pg_log_error("cannot vacu

Re: [Proposal] vacuumdb --schema only

2022-03-06 Thread Justin Pryzby
On Sun, Mar 06, 2022 at 09:39:37AM +0100, Gilles Darold wrote: > Attached a new patch version that adds the -N | --exclude-schema option > to the vacuumdb command as suggested. Documentation updated too. > > + pg_log_error("cannot vacuum all tables in schema(s) and and > exclude speci

Re: [Proposal] vacuumdb --schema only

2022-03-06 Thread Gilles Darold
Le 04/03/2022 à 11:56, Justin Pryzby a écrit : > On Fri, Mar 04, 2022 at 10:11:28AM +0100, Gilles Darold wrote: >> The attached patch implements that. Option -n | --schema can be used >> multiple time and can not be used together with options -a or -t. > Yes, thanks. > > I suggest there should also

Re: [Proposal] vacuumdb --schema only

2022-03-04 Thread Gilles Darold
Le 04/03/2022 à 11:56, Justin Pryzby a écrit : On Fri, Mar 04, 2022 at 10:11:28AM +0100, Gilles Darold wrote: The attached patch implements that. Option -n | --schema can be used multiple time and can not be used together with options -a or -t. Yes, thanks. I suggest there should also be an --

Re: [Proposal] vacuumdb --schema only

2022-03-04 Thread Dinesh Chemuduru
On Fri, 4 Mar 2022 at 14:41, Gilles Darold wrote: > Hi, > > > When we want to vacuum and/or analyze all tables in a dedicated schema, > let's say pg_catalog for example, there is no easy way to do that. The > VACUUM command doesn't allow it so we have to use \gexec or a SQL script > to do that. W

Re: [Proposal] vacuumdb --schema only

2022-03-04 Thread Justin Pryzby
On Fri, Mar 04, 2022 at 10:11:28AM +0100, Gilles Darold wrote: > The attached patch implements that. Option -n | --schema can be used > multiple time and can not be used together with options -a or -t. Yes, thanks. I suggest there should also be an --exclude-schema. > I do not propose to extend

[Proposal] vacuumdb --schema only

2022-03-04 Thread Gilles Darold
Hi, When we want to vacuum and/or analyze all tables in a dedicated schema, let's say pg_catalog for example, there is no easy way to do that. The VACUUM command doesn't allow it so we have to use \gexec or a SQL script to do that. We have an external command vacuumdb that could be used to s