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 1uhBuK-00BX6a-3b for pgsql-hackers@arkaria.postgresql.org; Wed, 30 Jul 2025 18:52:09 +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 1uhBuI-00BxQA-Vs for pgsql-hackers@arkaria.postgresql.org; Wed, 30 Jul 2025 18:52:07 +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 1uhBuI-00BxQ2-ET for pgsql-hackers@lists.postgresql.org; Wed, 30 Jul 2025 18:52:06 +0000 Received: from mail-qv1-xf2c.google.com ([2607:f8b0:4864:20::f2c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uhBuG-001bPF-0F for pgsql-hackers@lists.postgresql.org; Wed, 30 Jul 2025 18:52:05 +0000 Received: by mail-qv1-xf2c.google.com with SMTP id 6a1803df08f44-70756dc2c00so1529926d6.1 for ; Wed, 30 Jul 2025 11:52:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dunslane-net.20230601.gappssmtp.com; s=20230601; t=1753901521; x=1754506321; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :references:cc:to:from:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=S7zUMlxqPaA+Foz/9e2h+2/2obXTu59dY5WrlppVV0k=; b=xYAbomvWJYLPg6eV6tWhjNCmlzYLLtpr4EAKB/k7dkjkf5vhzbgMxdZLiQmcHv8tBU J/rWUw+vyRp1XbSV7pPQZ5iHxFxT0UCk+bHnEpV3JGaM9PbPb9AwtS6NBn9jvmWo1NX3 lagdpqTh0MV3cgSMkBqFASBMAfqwl+6p7qdaoifdkdDilleT2zcIZeQYPhlV7MeoQAr2 Z5PBEF9ZNttfZpWFrgAdl9HgnqOP/uUymgJOMk9kfHif8fpKiLnaEP0wjc+EBSJMtT9T icJ8ezOuMuSewIipEeG6xYCeOmpPkEc1nmtA/yTH6MR82GO6aqFtVtgPRlhD1L/WEEIm e6BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753901521; x=1754506321; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :references:cc:to:from:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=S7zUMlxqPaA+Foz/9e2h+2/2obXTu59dY5WrlppVV0k=; b=qJ4IYK279zn6T+sIsrefJhB+VzC1sHqAm7yb5uoU+rE/I+0CNY+Ds/JgALqulbbepR 1KZFgaFthr1ln2BHQx3IHyRXt+UBF//cOdBsTqPDwZ1IVd34MvunkCvvV4H8rB8e1mbL JxoAodwMzNmUOfGPBus5nD2LdIio6HMIFVwq30xOT/4QTnfDiMJ5a1p0V0f/Tm7moZ5z kpOVn2YzloL6yQiFXzE0o2KfuJB6UJ1AZW23KjIWW80m2D3qqXuKtMcnp5zquU0b0SIF 4F6bgmTGXqwdBmKRXT2jUQzyYSi7Crfcsyg6nps3bb+oAzKWRNl/r/YFA54kzj0fkfyv tSxQ== X-Forwarded-Encrypted: i=1; AJvYcCVvV4W+93skUb8MIgL15cobI8BxNRteyCx2IFDnnu5MLUHZTxeKL90BW72JHBHIPU+1qmP0TI9Yfrr3gRxg@lists.postgresql.org X-Gm-Message-State: AOJu0YxXwYoWbtL1FzBpW67owEt7qWROXos4Emnw43vNtX5/2MTo0Rdz v78OPEvFIGxwaNk99p4Q/K2mzTE0fgoIyR6wGh2wLNqgbj1VqkFOwRwBgL/Pq0+jrEM= X-Gm-Gg: ASbGncsAcHW8qbi+mkz3El4m0W+IEfu+k9ys3FhWauurSY8Ht+M4fSoB8kt+TK+Qcaz ts1sr3HdMntQdoXgESFv9AKDTPDJEnPLnJcT5iIJt59JSIFfafSAR/cJ5Qo3sA85GfHz9FhYfVy DZdQWjiI1azFN86WEKp7Q86fAL3EFMtX9Kud0S+0Q1qAnYVnV9inALCvUhCHQsPDVoYW56gbsb/ /X7MmzKimbi9QcJzUzg+CsPpK20yIU3R44JGSlneNxF/oivyiQWn7AQLy/FEwAz+AC/AU/cRTOD sbpQcWw3/Vj7vpwztPcfXwGCjNMQ6oNc6rEMsPYJUfgazzaJ0mam+ytnkX+MP+kY0gpadWhmqmf 7vRBjuKYdSAkDYwqvsPgrKzih0jBga7EWulWhB7bV X-Google-Smtp-Source: AGHT+IHsXI49MJ8zk2pyJ4dX4IYhWje+Dr9T3F5geNDhB//Ra1YdmV8BvVUXqWr8k7ucjtpqoWZCjA== X-Received: by 2002:a05:6214:2526:b0:704:7c55:4ff3 with SMTP id 6a1803df08f44-70766de22d1mr51491446d6.4.1753901521323; Wed, 30 Jul 2025 11:52:01 -0700 (PDT) Received: from ?IPV6:2605:a601:a6b0:500::1cb? ([2605:a601:a6b0:500::1cb]) by smtp.googlemail.com with ESMTPSA id 6a1803df08f44-7073fe6903fsm51356486d6.11.2025.07.30.11.52.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 30 Jul 2025 11:52:00 -0700 (PDT) Message-ID: Date: Wed, 30 Jul 2025 14:51:59 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Non-text mode for pg_dumpall From: Andrew Dunstan To: Noah Misch , Tom Lane Cc: Mahendra Singh Thalor , =?UTF-8?Q?=C3=81lvaro_Herrera?= , jian he , Srinath Reddy , pgsql-hackers@lists.postgresql.org References: <20250716001957.c6.nmisch@google.com> <3f22a8bb-29e8-40cc-97a1-309181da2c13@dunslane.net> <20250722005339.ca.nmisch@google.com> <20250725162141.6f.nmisch@google.com> <2225040.1753477169@sss.pgh.pa.us> <20250727235628.e2.nmisch@google.com> <8f2ad50b-ebb7-4adc-997e-25e0ad96ff34@dunslane.net> <2bed001a-462c-42da-9a6b-3c7884502932@dunslane.net> Content-Language: en-US Autocrypt: addr=andrew@dunslane.net; keydata= xsBNBE7KWFkBCAClridxur2AIc7eW2AR7izbfp3EnNefie2HbLF0izW5Ik5UjX2HBXBx4syI gY6b0ugohXrr274+baoAlvSbq6cAoQuEVrk5IZFzt20b1Xkx65FwGSEj526yiKLocqkJceSq Xr9xcA5SGY+FZv441chh5SU92v4q6z+6LPpoHOh97ptAVXZYNTtU0LevyvD5lja0TzbvJm6C eFXitJfnm1pLEr0DGJCR/iUOl/N62Kh4855zZC7NHIjQHPOvV5Stz/l5ilDhvGVk+xkXFPys SjZoUr1rXhYLpiyi5sR0X9FHXT0KnGuz1F5ERO7ZTLSSQ6fJwPj6gOk9K+vvoKvoeql5ABEB AAHNJEFuZHJldyBEdW5zdGFuIDxhbmRyZXdAZHVuc2xhbmUubmV0PsLAlwQTAQgAQQIbAwIX gAIZAQULCQgHAwUVCgkICwUWAgMBAAIeBRYhBOQ+WEYd/Hy/RGkVpZn6f8tZ/DuBBQJoGNGd BQkdEO8nAAoJEJn6f8tZ/DuBq74H/jkTR4Zi3stbw+xC7v2u3QozssK7MYPL2AsVfh7OealS h182fiWXpfvmmAB7WUHbhk9GC2RAOnHI/2d2jgKaMLAHsGYOT0YopTVIwRY43fCw/mK67yxc wmDcX+zyKfLaivNbf5A7QPLNwda98bEAMSJ8Sn652Uc6cA8t3uKGsVzbRBQOoYzjgvBCfSrE 9ql3PDNg0l4BfAqabd2f70ZUm9VAMEPrgv/v2xI7M2XiL4g5BVmqLCOwxLM8RMCotCuoweUr VO43DeBCIDwLxotMJKvGWDjBzQYlU1NPUAtNcz/gN9ITUe1VUGjyvGj4u1lxBOcQQUw7l1+T 5moZ4iZxXzvOwE0ETspYWQEIANGc4zQULOxhbqO2dyD51YhqCNRmm9oKWaqf+wmW4tpDe/VV cxAnNizd4LWCHfzpb5cHAtGkOPePMfzWVf6nvdF7d3eglbtf59+zG7O7llV0xSSoFiieQBsr GvqDInXYX/4mRRXMtyhM353/tixC9RWLs1oofyYmCPPXXY7h9R7en3B8BoVrRFcdzlIY/NFN hFGW/9dkEiGjgna2Rk6e15kln4ZvFBWUg23p93w/pqXcxY6+k/8TEk+C4R+M6w7o2PLGOjdZ +kPiUcw5H85zf/yZJwQXzisXaNduwWB6Vads9YC9dj6kPR1c4VGRqAaYL++LAEOqrlvm2Tvq QqZRtnEAEQEAAcLAfAQYAQgAJgIbDBYhBOQ+WEYd/Hy/RGkVpZn6f8tZ/DuBBQJoGNI2BQkd EODdAAoJEJn6f8tZ/DuBfw0IAKTsfD40teP/pp+bsLLMSxPXUYrrprTj7WFB5v61p6dkpSr/ qXmMlyahdxQFaPmfVgVirB1Vk/kHiWNnnGjfUV9nB2Zg9LI0Xb9/ts3LsUiRWXzG3tkMY6XL vsVOxW4XFRND9l2q+WW93aZ1DZl+fqWfYgMvsusFRhmGFOKTRfKPta2Pkv+AhA24N4+PrR5p bU4k2MO8PAGiK8eaYKGFG1bHKuAvoDoF7WXJ3FHxuWqLnKEt4dfOLm5pAe3zq1Lt6q8azT9i QWGpSAK5vQUWQHBHpiDjdPeqKZ6HiAXIIKfSmb+jrvXBqoP+D6/K7rUjG2aXiRtTIAXms9sm VRu7cmw= In-Reply-To: <2bed001a-462c-42da-9a6b-3c7884502932@dunslane.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2025-07-29 Tu 4:09 PM, Andrew Dunstan wrote: > > On 2025-07-28 Mo 8:04 AM, Andrew Dunstan wrote: >> >> On 2025-07-27 Su 7:56 PM, Noah Misch wrote: >>> On Fri, Jul 25, 2025 at 04:59:29PM -0400, Tom Lane wrote: >>>> Andrew Dunstan writes: >>>>> Before we throw the baby out with the bathwater, how about this >>>>> suggestion? pg_dumpall would continue to produce globals.dat, but it >>>>> wouldn't be processed by pg_restore, which would only restore the >>>>> individual databases. Or else we just don't produce globals.dat at >>>>> all. >>>>> Then we could introduce a structured object that pg_restore could >>>>> safely >>>>> use for release 19, and I think we'd still have something useful for >>>>> release 18. >>>> I dunno ... that seems like a pretty weird behavior.  People would >>>> have to do a separate text-mode "pg_dumpall -g" and remember to >>>> restore that too.  Admittedly, this could be more convenient than >>>> "pg_dumpall -g" plus separately pg_dump'ing each database, which is >>>> what people have to do today if they want anything smarter than a flat >>>> text dumpfile.  But it still seems like a hack --- and it would not be >>>> compatible with v19, where presumably "pg_dumpall | pg_restore" >>>> *would* restore globals.  I think that the prospect of changing >>>> dump/restore scripts and then having to change them again in v19 >>>> isn't too appetizing. >>> +1 >> >> >> OK, got it. Will revert. >> >> >> > > here's a reversion patch for master. It applies cleanly to release 18 > as well. Thanks to Mahendra Singh Thalor for helping me sanity check > it (Any issues are of course my responsibility) > > > I'll work on pulling the entry out of the release notes. > > > OK, now that's reverted we should discuss how to proceed. I had two thoughts - we could use invent a JSON format for the globals, or we could just use the existing archive format. I think the archive format is pretty flexible, and should be able to accommodate this. The downside is it's not humanly readable. The upside is that we don't need to do anything special either to write it or parse it. There might also be other reasonable options. But I think we should stay out of the business of using custom code to parse text. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com