Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uf08f-000oiK-TE for pgsql-hackers@arkaria.postgresql.org; Thu, 24 Jul 2025 17:53:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uf08e-009cxT-E8 for pgsql-hackers@arkaria.postgresql.org; Thu, 24 Jul 2025 17:53:52 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uf05Z-009ZzK-RE for pgsql-hackers@lists.postgresql.org; Thu, 24 Jul 2025 17:50:42 +0000 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uf05Y-000adE-1n for pgsql-hackers@lists.postgresql.org; Thu, 24 Jul 2025 17:50:41 +0000 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-747c2cc3419so1117979b3a.2 for ; Thu, 24 Jul 2025 10:50:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; t=1753379439; x=1753984239; darn=lists.postgresql.org; h=user-agent: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=c4KBeDWOeG3/ylhcgqYi8s6OxPZJWkGTGKSywQQs/lg=; b=U8BRJVGKoWlE3n5pQP7e3wy3939Ge5wbS0SErl83R2RsVSYygTr+UdxqKF9Gn+W5/W 24X0dbifFMPXG1vWGYkdoUg6yqY4xT3SFV3Lt2gepXkmN2gbhCYE+2oH1dJeO0E1jFr5 SYcopovZf6pXXrv7ozG5MEQHVj4+DU2BdsR/M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753379439; x=1753984239; h=user-agent: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=c4KBeDWOeG3/ylhcgqYi8s6OxPZJWkGTGKSywQQs/lg=; b=tDSatH4JVFYz2mNdFOvVAdELdUslEq6CvMR7WqQ8ARUGWO86dFaIFUiWVe+iyJd9R4 pvTXjwHuH/8POGZsL4tZDM3mJ7jEfXY3CBT4Ol/PTgPnF397hT7RhTo/MyConVdvfZlA zvWpN1heXkAliJpdiV/tw70Cg1pWHguK0VAD9gNuu179oBBm71H3YdLYog0so8u+ZI0F 1nProWBzH9fc5Y8/Cdaoot6qfRq6dUFp7+yqx7EymQuD2lV9o5b7j7Oh5JrWt7vjMfrm 4fePCsp9oiqx4xE1MZnH8i4nbFHll0eFOdJiPc1apmNRB5fcDO2eIyHPn8v/1JrBeAKn IgMw== X-Forwarded-Encrypted: i=1; AJvYcCWkrU6/t+1s42gbmQ1H/HiEJn0hBjKLgWg3LPuhdYy3+h0LLS6FvoJPICiIstzNQJu6Esh5CXovurxybY8R@lists.postgresql.org X-Gm-Message-State: AOJu0YzOuuesyhgByPOmR1zA4SmSzVM2pUlRoei3ddADOfELRRwFw0NR 99jGd8cwJHc0lxbi5z0K4dNbGLPY57ZFpOkleuNrUnNaKsTeva/AjXJCfcIhRmPhPQ== X-Gm-Gg: ASbGncvVKbybqSf7fZL53y0CuUeOtCO9IVEJBdFRfxkH8QkOM6D1v2LleGgwE/oLfVj 5qt4/6NuRTAt4cNHO0nmxUJKehVT/ch9njJHowpupTDTWFZZIR9t2jxaERSwePQVUAKuLJZOQyV PhcflgcpThT/iojRZjGCd6Iql+jzfAXgVWz+uCNi2HQSdNV9krCBvY1e9toPPJw/mSjx7iXQL/+ 2AvBIyUHuWNFZSVSpEu4v3aX3gbqQcewOI+9M8VuAUcssd8xr6VF7g85Ct6L89NGfgnWM6h2Lr6 MjKpx0syn6OnIytqOVHkCgUblbZsYEpkBWZX5cp2tKdfczHJTNBNDKd8Yis3Mkdk3pv7HMcPEqC J4M0x70tKJ26+Ib17OqZLMcHSXjn9Fmc4DMCDK/TDp83IOhnXrMDaAtaGvKt2HQ== X-Google-Smtp-Source: AGHT+IEMxBY57pqalW7jNQYL6s5SmPc18gfQS9bgUeag1aYfruowZqKmh3SIH5kd8Mr21ptI2VFRrA== X-Received: by 2002:a05:6a21:689:b0:220:7b2e:5b3f with SMTP id adf61e73a8af0-23d4905d097mr11819284637.19.1753379439332; Thu, 24 Jul 2025 10:50:39 -0700 (PDT) Received: from google.com (c-73-15-160-255.hsd1.ca.comcast.net. [73.15.160.255]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b3f6c12625csm1840951a12.69.2025.07.24.10.50.38 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Jul 2025 10:50:38 -0700 (PDT) Date: Thu, 24 Jul 2025 10:50:36 -0700 From: Noah Misch To: Mahendra Singh Thalor Cc: Andrew Dunstan , =?iso-8859-1?Q?=C1lvaro?= Herrera , jian he , Srinath Reddy , pgsql-hackers@lists.postgresql.org Subject: Re: Non-text mode for pg_dumpall Message-ID: <20250724175036.22.nmisch@google.com> References: <202503311812.vxg5b7rzfgf6@alvherre.pgsql> <616efe2c-3986-43cf-b88c-4435849acf9e@dunslane.net> <948154fe-0278-4f4c-8f5a-085e12f03163@dunslane.net> <20250708212819.09.nmisch@google.com> <20250716001957.c6.nmisch@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.2.12 (2023-09-09) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Jul 17, 2025 at 03:46:41PM +0530, Mahendra Singh Thalor wrote: > On Wed, 16 Jul 2025 at 05:50, Noah Misch wrote: > > On Thu, Jul 10, 2025 at 12:21:03AM +0530, Mahendra Singh Thalor wrote: > > > On Wed, 9 Jul 2025 at 02:58, Noah Misch wrote: > > > > On Fri, Apr 04, 2025 at 04:11:05PM -0400, Andrew Dunstan wrote: > > > > > +/* > > > > > + * get_dbnames_list_to_restore > > > > > + * > > > > > + * This will mark for skipping any entries from dbname_oid_list that pattern match an > > > > > + * entry in the db_exclude_patterns list. > > > > > + * > > > > > + * Returns the number of database to be restored. > > > > > + * > > > > > + */ > > > > > +static int > > > > > +get_dbnames_list_to_restore(PGconn *conn, > > > > > + SimpleOidStringList *dbname_oid_list, > > > > > + SimpleStringList db_exclude_patterns) > > > > > +{ > > > > > + int count_db = 0; > > > > > + PQExpBuffer query; > > > > > + PGresult *res; > > > > > + > > > > > + query = createPQExpBuffer(); > > > > > + > > > > > + if (!conn) > > > > > + pg_log_info("considering PATTERN as NAME for --exclude-database option as no db connection while doing pg_restore."); > > > > > > > > When do we not have a connection here? We'd need to document this behavior > > > > variation if it stays, but I'd prefer if we can just rely on having a > > > > connection. > > > > > > Yes, we can document this behavior. > > > > My review asked a question there. I don't see an answer to that question. > > Would you answer that question? > > Example: if there is no active database, even postgres/template1, then > we will consider PATTEREN as NAME. This is the rare case. > In attached patch, I added one doc line also for this case. If I change s/pg_log_info/pg_fatal/, check-world still passes. So no test is reaching the !conn case. If one wanted to write a test that reaches the !conn test, how would they do that?