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 1omSXJ-0003VX-NX for pgsql-general@arkaria.postgresql.org; Sun, 23 Oct 2022 04:24:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1omSWI-0006T7-Qx for pgsql-general@arkaria.postgresql.org; Sun, 23 Oct 2022 04:23:30 +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 1omSWI-0006P5-E8 for pgsql-general@lists.postgresql.org; Sun, 23 Oct 2022 04:23:30 +0000 Received: from mail-oi1-x22d.google.com ([2607:f8b0:4864:20::22d]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1omSWD-0006GC-TB for pgsql-general@lists.postgresql.org; Sun, 23 Oct 2022 04:23:29 +0000 Received: by mail-oi1-x22d.google.com with SMTP id r204so4906961oie.5 for ; Sat, 22 Oct 2022 21:23:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=H81JhMDoOYMS3ffpMzcZrTfqB/iofkrQalC949zMuGQ=; b=ohA7ztKPIUJGSxty8j/JLJ/9mO8wdOztmwSmborHfxu0eEZoKSJBX4IkT588eiibx6 sIeFncpk4Soh397cigk+H0HBv9EuGw4wE//krMiUk4nqQ183I0OkaHyor0fY8CoHalng D+iKZWadRMvln/HLfbrMzctJpaaXw2Gj0snmcEhO+j1N4Eo/Uc5ToBvYxrHXhICwjaDF M5HEjAMKynpwAy5bht/JaYpCIQRcmyp1Z+8zUId2syPyj6kKvJox/nVt3Y1gyUMU6VlA FtMeGpMXx9Kn2yS0jwJ+g0rJlw8N4WjsUI1b7Bc/5BwoDq00cLdMD/9JeOhMVJ3iM9fH 92eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=H81JhMDoOYMS3ffpMzcZrTfqB/iofkrQalC949zMuGQ=; b=ekeWaMnlQ25PIOwSwGYSLtEnidLCsVR0e7IMmalwcwJ3+uBQY14Yi/KLvvAiqLBwLA 26X7LBMVW4grY4c2dZ+bkyf3UqAotLiS5arQizJ4dpMI1H+kT96YrNJ0fGrbkszhtbXZ M6fknbdGrqhzEvH+Dpwbuw36wFhFBXzWElzS7yvwHeoVCCni0ijeh+LuxQwTxx4S5zb5 ci0X+Hn/k2leQA1hFa44+KAdKScnfE5SudqQQMdBTyi36l9skpr95bLocAbulyPhb1OS uArDzX8F4ooLw04Rp0gYET7FeHUudsu40CyyICxSpel1LdAzGObxlbgOWo2SBhEbpGdK 0scA== X-Gm-Message-State: ACrzQf1NwXBpl2pILpaXTN1fIW83FDaezvxXS1LDPGL64sCdQkbgjvp7 cojuYtCfyfSN0KyWkcLg3aXfIdanNP0= X-Google-Smtp-Source: AMsMyM7/7PMzRDpBhs23R6wj5W3TTRIFD9BBxgR44KpzgikiNSZqub6mUpmTeNsWfvAIXOhf7De9PQ== X-Received: by 2002:a05:6808:1245:b0:350:c462:1528 with SMTP id o5-20020a056808124500b00350c4621528mr13339522oiv.112.1666499002911; Sat, 22 Oct 2022 21:23:22 -0700 (PDT) Received: from [192.168.88.10] (ip68-11-68-85.no.no.cox.net. [68.11.68.85]) by smtp.googlemail.com with ESMTPSA id o16-20020a056808125000b0034d8abf42f1sm2771808oiv.23.2022.10.22.21.23.21 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 22 Oct 2022 21:23:22 -0700 (PDT) Message-ID: Date: Sat, 22 Oct 2022 23:23:21 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: pg_restore 12 "permission denied for schema" errors Content-Language: en-US To: pgsql-general@lists.postgresql.org References: <287717df-88e2-a4a5-2025-260c39662bca@gmail.com> <40fd91d2-d981-2f44-4d58-a3f08a9448fb@familie-gard.de> <2980993.1666242738@sss.pgh.pa.us> <612cf1c4-1f2d-f068-d6cf-54b98bbeb646@gmail.com> <727e6a26-4b58-0aea-a701-9671b8935410@aklaver.com> <119d108c-0669-a15d-2afe-3c4116130118@gmail.com> <4da803e6-407c-19ee-53a0-618c6465ab81@gmail.com> <7d3c6371-b963-1c22-42e3-ecbff8e72f28@gmail.com> From: Ron In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 10/22/22 17:06, Adrian Klaver wrote: > On 10/22/22 14:45, Ron wrote: >> On 10/22/22 16:29, Adrian Klaver wrote: > >>> To pseudo for me. >>> >>> What file exactly is: >>> >>> pg_restore --jobs=X --no-owner $NEWDB >>> >>> restoring? >>> >>> And how was that file created? >>> >>> Knowing this might help get at why the more straight forward method does >>> not work. >> >> This is what I ran to restore the database: >> export PGHOST=${RDSENV}.xxxxxxxxxxxx.us-east-1.rds.amazonaws.com >> cd /migrate/TASK001793786/2022-10-19b >> NEWDB=sides >> pg_restore -v --create --clean --no-owner --jobs=`nproc` -Fd >> --dbname=template1 $NEWDB >> psql $NEWDB -f all_OWNER.sql >> psql $NEWDB -f all_GRANT.sql >> >> The name of the database is "sides", and there's a directorynamed "sides" >> under /migrate/TASK001793786/2022-10-19b. > > Aah, I forgot about the -Fd, now it makes more sense. > > To get past the --jobs induced error required the addition of --no-owner > and then adding owners and grants after the main restore. > > What was the pg_dump command that produced > /migrate/TASK001793786/2022-10-19b/sides ? PGHOST=mumble.xxxxxxxxxxxx.us-east-1.rds.amazonaws.com PGUSER=postgres cd /migrate/TASK001793786/`date +%F` DB=sides pg_dump -d $DB -j4 -Z0 -v -Fd --file=$DB 2> ${DB}_pgdump.log -- Angular momentum makes the world go 'round.