Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qEyhA-0002CP-HF for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Jun 2023 20:56:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qEyh8-0001Dw-4y for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Jun 2023 20:56:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qEyh7-0001Dn-PT for pgsql-hackers@lists.postgresql.org; Thu, 29 Jun 2023 20:56:49 +0000 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qEyh0-001Ejw-MH for pgsql-hackers@postgresql.org; Thu, 29 Jun 2023 20:56:49 +0000 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1b80b3431d2so7037075ad.1 for ; Thu, 29 Jun 2023 13:56:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688072201; x=1690664201; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=gG60c29APg8oQG+FK7chp7OkMpfni7RLwaO7D+xjXbs=; b=X1Udg5l5Ui6hvQ+f0uGkklEhu63voNTlPYwICGyfJHcoiIjt+evmBft7q3GQxxpNSD ebq1Ue4v+o+7KoBBLJqUYz8uUDMZkQwpV7bzcuNnwLa4V3Dm92R3ZK7uSRWp4epRjfrf n07jF7Ei3ycOP1UW+3c7hk72iu5cEcdAmvMyZYb6hQS+tLMqUjXUk45x2LP8YhJKXqjs LSpTO3Zt/pHogxWSzwixNUMX06nOR13N3bbvIt0GpMpL2MhM0RhjXzd4TrFsp6p/N/FA LqWpzXYeTCzt9QHbIT+d+kvvwnE/OCZ3IxiL+H9jNGQjdcXVdplGLaLHb1eR7F9cXgUL tMPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688072201; x=1690664201; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=gG60c29APg8oQG+FK7chp7OkMpfni7RLwaO7D+xjXbs=; b=N6ga5tUevMX+hdiLCrTtHm2bWVbFV7JcJp/TPq6ogPxfDXNRq51RaubaDg9zgBI0li AbZNCNNRCfjcfOjGvqz/uHlnZtGbu1Z5gRRxw+RYuMjuVjo8i3sGBpOFMEQoOnxO5rCr nav7MXHad16PPATidf0NskufiKva50zrf15xliNKoQcYPQ4JMwEW/hd4gr/qrY+VdY6O gx6hG8nKbqYG+kmURv99Tvd2M604rAvsBRIULlee+2nG0vQjjjxlPL9ulAGR7Pslc7mu +sJh27X3WUBpJ0K3r2qytEM9upmK4PKo0zO9vuOhSJNB6moEWFQn6YMun0AcKHLikPpt CjDQ== X-Gm-Message-State: ABy/qLYdhD2kIb13+KJch2ysJR5WFOQ2/hwA08d6f4o6FM0+2wMKajPL hog5YCWeUvFhaz00QrPuw33N8nMkkwI= X-Google-Smtp-Source: APBJJlFiEE1mNHStYIffVuZWHjeJwsmcqwa2imFIkz6XZzLJJfv8HlVoP5u/khblqQxx8hkd4/BF/w== X-Received: by 2002:a17:903:2656:b0:1b6:6bac:d976 with SMTP id je22-20020a170903265600b001b66bacd976mr292463plb.48.1688072200684; Thu, 29 Jun 2023 13:56:40 -0700 (PDT) Received: from nathanxps13 ([50.47.162.83]) by smtp.gmail.com with ESMTPSA id q11-20020a170902dacb00b001b20dc1b3b9sm9433769plx.104.2023.06.29.13.56.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jun 2023 13:56:40 -0700 (PDT) Date: Thu, 29 Jun 2023 13:56:38 -0700 From: Nathan Bossart To: Kyotaro Horiguchi Cc: pgsql-hackers@postgresql.org Subject: Re: vacuumdb/clusterdb/reindexdb: allow specifying objects to process in all databases Message-ID: <20230629205638.GA2054380@nathanxps13> References: <20230628232402.GA1954626@nathanxps13> <20230629.141626.886053266048932185.horikyota.ntt@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230629.141626.886053266048932185.horikyota.ntt@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Thanks for taking a look. On Thu, Jun 29, 2023 at 02:16:26PM +0900, Kyotaro Horiguchi wrote: > At Wed, 28 Jun 2023 16:24:02 -0700, Nathan Bossart wrote in >> I debated also allowing users to specify different types of objects in the >> same command (e.g., "vacuumdb --schema myschema --table mytable"), but it >> looked like this would require a more substantial rewrite, and I didn't >> feel that the behavior was intuitive. For the example I just gave, does >> the user expect us to process both the "myschema" schema and the "mytable" >> table, or does the user want us to process the "mytable" table in the >> "myschema" schema? In vacuumdb, this is already blocked, but reindexdb > > I think spcyfying the two at once is inconsistent if we maintain the > current behavior of those options. > > It seems to me that that change clearly modifies the functionality of > the options. As a result, those options look like restriction > filters. For example, "vacuumdb -s s1_* -t t1" will vacuum all table > named "t1" in all schemas matches "s1_*". Sorry, I'm not following. I intentionally avoided allowing combinations of --schema and --table in the patches I sent. This is the current behavior of vacuumdb. Are you suggesting that they should be treated as restriction filters? > While I think this is useful, primarily for system catalogs, I'm not > entirely convinced about its practicality to user objects. It's > difficult for me to imagine that a situation where all databases share > the same schema would be major. > > Assuming this is used for user objects, it may be necessary to safely > exclude databases that lack the specified schema or table, provided > the object present in at least one other database. But the exclusion > should be done with printing some warnings. It could also be > necessary to safely move to the next object when reindex or cluster > operation fails on a single object due to missing prerequisite > situations. But I don't think we might want to add such complexity to > these "script" tools. Perhaps we could add something like a --skip-missing option. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com