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 1twmk2-0004qy-8A for pgsql-general@arkaria.postgresql.org; Mon, 24 Mar 2025 18:41:42 +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 1twmk0-008ITh-N6 for pgsql-general@arkaria.postgresql.org; Mon, 24 Mar 2025 18:41:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1twmk0-008ITZ-Bp for pgsql-general@lists.postgresql.org; Mon, 24 Mar 2025 18:41:40 +0000 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1twmjx-000vVM-2M for pgsql-general@lists.postgresql.org; Mon, 24 Mar 2025 18:41:40 +0000 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-3912baafc58so3763912f8f.1 for ; Mon, 24 Mar 2025 11:41:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1742841697; x=1743446497; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=JhwzwuOa6iQLaws8uduWQhIoPBvSkYkr3wn8kL0SRqA=; b=d5H6gC6zLzIwKvNI0riHYHMX/KkuaqqCHkXeGZHkteJUvQFf4vzC9z9xHwTjQOcKnh PUCobTao7vqbxB+pYLtvpJhpnW67iG4R/i7LiIHY6iAuHvD+vguPMDrvhoiVIcA9rH7E wQRQKo/4ND1BF2bsUCjR3akDGHKEgmYxaOfJw5EwKqWZ90HQqZuPTl9LrJJYDhNqM+CS KyN5lQeYVHApR3dHNOuywH30gsXtLs5RuQHMiewhk+PeUEQoarSg15+4DuwGheAzUjMk unawr4QQZ9xb6BG3AIRhVmgeA7wLbjZiZxuP2ykMWl59izVv/S8BIY8wE7NDwrQRMchD 7yCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742841697; x=1743446497; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=JhwzwuOa6iQLaws8uduWQhIoPBvSkYkr3wn8kL0SRqA=; b=Ga9thm0Y2Mm/qvjQbgSzX7UjmjbLmitQrTiNqrT7fE8ICjjSqxm4wCQypw2B02Zcyu rzlWuUZZjgrH898e13X5FXct0Cg/E3tbK8/E/Eie6M2BIrthSKKkYJxZ5KhrgR8lG/3T nFAzizNEnNSfsZ+t8C1WPRvMczbKbiAyv/EXJ2O6juatwF8d07UWxrXxfJKXT6T8F+ep ddptY69LHbNBfM1PjyuR3MTv9wVQmP88Ah5mw8qfJfLuPDujZFozAwv3xSjxPqpUlJkQ +/UhyULbO0BeSzMf4LP4O3smafEhkf6D0vwZXFDlcbOG9P87yRdcROkYY3YB1KxkSqZ4 GShA== X-Gm-Message-State: AOJu0Yx7bk8ZOnyumZGf5Pn0WGQTolK6+3uUg/gZw8AkDnCtXr/rN40L sBfmjEyQneDg9ZrtP9KREqBxTjLg+SMB8iJls3tiisHakUx+DsoTPtlMe8EHZq8bGZ0bpLOXWLa H X-Gm-Gg: ASbGncs3peBl6IySkJ6hPuBEFUBoC458+701XwMVghBGfk+klrU4R7xf6WUO8E8zNnZ jUFeTjOk3jzz1cvQEk6cHhoGB8TAZ3umBZ10Muwh45cXIYKXq6K85Le25lATFcfxXf/e252iKKJ YVoRKHJE9hZOmneNqilXVPk7TxnJmdVIRlmmkeQT3fhkJJelwKFd+m1XIjQ4nEWwYrHHq+JVjiN UNti/0z1fqZ5xt09unkVFCHlSIApiqhIMcUqEBeyIU23oIzp5xN+hJBu2kin0GesTU3dT4bIUsy +2ogxOWyaSue7Ygal96l31XZad7oiPpYPWxRVkpBhDhWIlH5FPiykzsf4Y0O0LA= X-Google-Smtp-Source: AGHT+IFwWa8ibghHg3fWCztY7AiasoZJpqW1QSGsheTdfPJ8+8Uq+yVeJLkeBHHWKk8Y2t7CuFFbAA== X-Received: by 2002:a5d:598b:0:b0:390:eb50:37c3 with SMTP id ffacd0b85a97d-3997f912873mr13550717f8f.27.1742841696604; Mon, 24 Mar 2025 11:41:36 -0700 (PDT) Received: from localhost.localdomain ([2001:871:260:9d2f:b0b3:8a:8452:71c0]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43d43f332adsm180250105e9.3.2025.03.24.11.41.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Mar 2025 11:41:36 -0700 (PDT) Message-ID: Subject: Re: Experience and feedback on pg_restore --data-only From: Laurenz Albe To: Dimitrios Apostolou , Adrian Klaver Cc: pgsql-general@lists.postgresql.org Date: Mon, 24 Mar 2025 19:41:35 +0100 In-Reply-To: <7e990eae-e55c-0d04-1be8-f49bb3251073@gmx.net> References: <53760c70-4a87-a453-9e02-57abc9cb2e54@gmx.net> <455d28421ae33c73b73a6f527d2f72816ca5dd29.camel@cybertec.at> <5f1ebeda-f080-cb31-75c0-ce2211ea348f@gmx.net> <832c1cdd-c0fe-464b-b4b9-f9d0482b9b78@aklaver.com> <7e990eae-e55c-0d04-1be8-f49bb3251073@gmx.net> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.54.3 (3.54.3-1.fc41) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 2025-03-24 at 16:51 +0100, Dimitrios Apostolou wrote: > Laurenz informed me that I could avoid writing to the WAL if I "create an= d > load the table in a single transaction". > I haven't tried, but here is what I would do to try --single-transaction: >=20 > Transaction 1: manually issuing all of CREATE TABLE etc. >=20 > Transaction 2: pg_restore --single-transaction --data-only >=20 > The COPY command in transaction 2 would still need to write to WAL, since > it's separate from the CREATE TABLE. >=20 > Am I wrong somewhere? No, that is correct. Yours, Laurenz Albe