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 1lO1gI-0000Oe-Qi for pgsql-hackers@arkaria.postgresql.org; Sun, 21 Mar 2021 17:16:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lO1gH-0000kd-LM for pgsql-hackers@arkaria.postgresql.org; Sun, 21 Mar 2021 17:16:01 +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 1lO1gH-0000kV-Ec for pgsql-hackers@lists.postgresql.org; Sun, 21 Mar 2021 17:16:01 +0000 Received: from mail-qk1-x732.google.com ([2607:f8b0:4864:20::732]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lO1gD-0003rF-QP for pgsql-hackers@postgresql.org; Sun, 21 Mar 2021 17:16:01 +0000 Received: by mail-qk1-x732.google.com with SMTP id 7so8309456qka.7 for ; Sun, 21 Mar 2021 10:15:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wi3ck-info.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=2qDCmFoFtp+QoPz2s8OZNF9KY/GZuMSPyX4kQYorJi4=; b=aPwdeC8yTjzmdllzxkRinc+RvBic6Sg55qGmBjP0xbKJe07vhrIMMQE4F8JmF50s1n ZNNLUDdE9oOl+M3pItPQ9LSVp5X+BXFhLYScUWQZfiC4DLV7UCVRiUoWMh4nDbMwQ5Zz PQrpHT4ziudnF8JrAgARfhZbS8XnR0xS6QUyIbQwZxyZs0gyFwIojvnd1B+tgqjtvHIJ Yt7L0IkeUcN1CA9KTkwlyjUkUfRnyLCa2DqZIuB3l79mM4DiVnqyn2SHSfHNi/hTlFMK mJ4HocMRatb5nzntnzdj47DOYZvpUlYTElslEeFeKynvANpZFvFBU4FVuYMjtXfu8ZeP NyGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=2qDCmFoFtp+QoPz2s8OZNF9KY/GZuMSPyX4kQYorJi4=; b=DNWNELjBt5KPB6JCpsxXn+q9m5eIUbQLa5WuFkJTFmuwRGHvAXK7EDx7P+ygJgaxQl kk/Hok5wpvs1XnFL4KYex6sBSUbmuCJjmYCYuWlqr9oxIkThizpmrmdassTH3rKMvjc3 R4DOBhwd37VpqK99PAArqydqDQpRXOgjvluQCoxP7C7oI+H5zyfGSFtPThL0MNHh5fqp i4MTUS/kPY5m35IKWa6fclOZiQg6KMD08+y13c3aIGaVbPMlXcjDuTtexS/pjJhihg0V E+AR7HffQMSQgr5rFzmvvDWIiFXz61vFlRsVc1GOx0ZoJ80FAlmInu8vxef2bhscQrlo 6FgA== X-Gm-Message-State: AOAM533PNUjC6Wdlx7iNouMWj1IDPrj+DnkvWA6yYCqqpJzStj57OCuh evAa1HUIqgKHcYg8LHKUdTjLldxZw9SpZt3d X-Google-Smtp-Source: ABdhPJw0GzGupRL93HQLD/FqQ5QexK0HCklUWBltdtUlgR8S0rozgeKSXvBGiJPtnp1Ezaoi3MtIbA== X-Received: by 2002:a37:342:: with SMTP id 63mr7293485qkd.371.1616346955793; Sun, 21 Mar 2021 10:15:55 -0700 (PDT) Received: from jupiter.onmars.janwieck.no-ip.info (pool-98-114-241-134.phlapa.fios.verizon.net. [98.114.241.134]) by smtp.gmail.com with ESMTPSA id b198sm9121232qkg.10.2021.03.21.10.15.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 21 Mar 2021 10:15:55 -0700 (PDT) Subject: Re: Fix pg_upgrade to preserve datdba To: Tom Lane Cc: Magnus Hagander , Robins Tharakan , Peter Eisentraut , "pgsql-hackers@postgresql.org" References: <1742698.1615221182@sss.pgh.pa.us> <1743618.1615222719@sss.pgh.pa.us> <4fbf92f2-ec91-f4fa-a259-f0968e34f3d7@wi3ck.info> <0b5d506d-70d2-1506-bbdf-89e6453c0289@wi3ck.info> <384713.1616345832@sss.pgh.pa.us> From: Jan Wieck Message-ID: <2284b71d-af55-2625-f8c2-cedf1f1a70ca@wi3ck.info> Date: Sun, 21 Mar 2021 13:15:54 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <384713.1616345832@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 3/21/21 12:57 PM, Tom Lane wrote: > Jan Wieck writes: >> On 3/20/21 12:39 AM, Jan Wieck wrote: >>> On the way pg_upgrade also mangles the pg_database.datdba >>> (all databases are owned by postgres after an upgrade; will submit a >>> separate patch for that as I consider that a bug by itself). > >> Patch attached. > > Hmm, doesn't this lose all *other* database-level properties? > > I think maybe what we have here is a bug in pg_restore, its > --create switch ought to be trying to update the database's > ownership. Possibly. I didn't look into that route. Regards, Jan -- Jan Wieck Principle Database Engineer Amazon Web Services