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.96) (envelope-from ) id 1wHkwu-007UDB-1h for pgsql-general@arkaria.postgresql.org; Tue, 28 Apr 2026 16:06:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wHkwt-000YJf-25 for pgsql-general@arkaria.postgresql.org; Tue, 28 Apr 2026 16:06:11 +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.96) (envelope-from ) id 1wHkwt-000YJW-0q for pgsql-general@lists.postgresql.org; Tue, 28 Apr 2026 16:06:11 +0000 Received: from mail-yx1-xb136.google.com ([2607:f8b0:4864:20::b136]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wHkwr-00000003Y5F-0oJQ for pgsql-general@postgresql.org; Tue, 28 Apr 2026 16:06:11 +0000 Received: by mail-yx1-xb136.google.com with SMTP id 956f58d0204a3-65075c2ba66so9572644d50.1 for ; Tue, 28 Apr 2026 09:06:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1777392367; cv=none; d=google.com; s=arc-20240605; b=ixFVS1if8Jcxo8LkgaK8M3uWtQnOwbCGSmdq4Im75bbgfzs0/NKtah+oLKz2e9UGA3 HV1chDCTljCplzPmn4nTsPx+BnBsx8BD2f8W89T0VZowckKctE6K/27xiZA/w5o1ky6m RqKSsNJxCTqwluenDthnXiW8B1p6qcVI70rLDgX6f2+Wh1zz9eGK2sw1HOgyxDFSTJ5J 3OL0F57xOn241+Mo8Vdh2qRj+/bDsJYPKZQPp4TFwpI7IX2nsJ8w8VEAV9OfobL+c+eK E8G6BBoWYF/HN12AAVYJADqIa5fFamv3vl+vaC7f+VpSuhsE2UZSQvLMKpkKvYfuT4MM IVGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=ZsrrSi95re70rHLgi1sbuMA50TAJzSkYxYquQ0kodUc=; fh=kIXepaLZMTcZ9IG80c/gsJO4qL6mrHbbLHrXt3larrc=; b=Bc4TrpflkFv7mcyWrueSb4WoPbNGVb+ayRXNG/kt08wJ/+FX9zplJV6TilC4UPS1ps u9Vci+wZmhxOwmFJMVHp01mSe4C/WcJ4TG1paOZ8Y4vpXc860EmAl0GCsCNnO7931qTD Rk61/2pZyEQgVPEJ2VqzBgm1iIh0aVjf4sAXWnhNXTgLyKle6ShyE/Pl2KHONcb9EpWm ocHR/bHcnv7RT7B9pe3S0NHMybTzc2wTGzdDEADXw9/QPsqWndJwYWiCFzcQpS1EFYIT KiZt814a8SGFzH+T0kLq9H3GDqvk6E3MBHRYqGIGxM1eG6heZrlVdyVrVRWVOBwsmAFJ RTMA==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777392367; x=1777997167; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ZsrrSi95re70rHLgi1sbuMA50TAJzSkYxYquQ0kodUc=; b=lJ7zETiHzoUIw2aYE5QBiNJCmpEM8kKIRfRRwjWqpKqdE5QteDOUiyDGVy/rAQhimP hlaacmzO4Qoi69kDuv0I41AkboKkm0tLRPgbJKgoJgY6L3OUhmm7gPZf37YKyftdhoKA B7/o/157lpLJLe8cnStnPeZbSjuL4giKqP0j/NpCQ7dXUJwO+no/JyFP0m+POSuvXfAy bu+Fk2Uzu6CZ2OXXVKWDAFNzgFd+wwdtUE7YrJ6HIzJHxW8Xdcc4UrD/du9OTajn7rlJ 7GcnQ3Besifooa9OFWEQNmxpIJ7hPWVu7JWNvvaYpVpUBMaqOg3pvFDxCiUzduSduOZl nCcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777392367; x=1777997167; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ZsrrSi95re70rHLgi1sbuMA50TAJzSkYxYquQ0kodUc=; b=D+7/3zwbZwaUHejW9HlMkbm7Y5YcHmWZDvdpAk/MLvFvfMwzW+FE+SZQA+Qz8dQEWS fMg887lZkipkQfHmLy8bMPAg72zRqCh9Y0cuebhirzRocBgpmBngwteR0W2r5/9jDxxI 4ygQIWiIOLvWa2Ph0hDN1lHnZcrtkZnvBDB7XI9dC2nuu78pCvsQ4kE2858LHXi0fnB6 KyyiE1iF3N4tzxTcyDedFlkiOioE2ODTZvF1r7VXa5ZIRkSRqH2c7jXPYs/Kb0rKUdxL lPX5n0y5S18TZ8CYX3O2wKtJ2pJHCjzgOank14ybHZkImle/0FQjlwa/fP1KHtPM19gL rQ2Q== X-Gm-Message-State: AOJu0Yygmr/5Mwi6EHdafyLeeC/Z+9uuxbSsPXKZfxKXBGvxZAyMjmHu YPerX4MY7zpEQSveW7I499Zj9jsjddYIQwDfsZjD6ObY8CuTcMMAVLcsM13j0cvOm4WAvC1rmjb QN0JmYx+BC6Qds0PcjkEZf8SBIa30ABY= X-Gm-Gg: AeBDieueyqaQeebFYrUWP28Rj7ShcOuA7UIxrdC3UVAcxtwF48XzJU9H9Vp93ytHN+0 opT3eO43NRUHDzEDPmCeBKIVmNg0oRGympsSXqhT8pcSIHMc1aUlMV8VklwsLlPATddhkBeQ/4M HU7edHa/8sJOKrewytcKyPxQ44vOGx7l2AgNboh+dxYXgJtcjJY89uoKpB3bHNwdt6Y+TjNrf7G euipJGLx+XSLQr1BUH6Ldzifi60CSJAEbIy0mRbeWgO4ImcSCGeNFkwOJpHCE9XTREXs1f7DuO1 FzemKkaMTx/ISUQpng== X-Received: by 2002:a05:690e:1919:b0:657:4568:c4c4 with SMTP id 956f58d0204a3-65beed74e6dmr3346056d50.18.1777392367452; Tue, 28 Apr 2026 09:06:07 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: "David G. Johnston" Date: Tue, 28 Apr 2026 09:05:31 -0700 X-Gm-Features: AVHnY4LCwlSp7fspgFs9vOQ2Ud72V8UCfQ5bJyIMtWm_ssVRVatZUs-0_a8YnWY Message-ID: Subject: Re: can recs be transferred between DBs ? To: dfgpostgres Cc: pgsql-general@postgresql.org Content-Type: multipart/alternative; boundary="000000000000b0456306508768ab" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000b0456306508768ab Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Apr 28, 2026 at 8:56=E2=80=AFAM dfgpostgres wrote: > > The managers tell me that they want to restore "beta" back to the main DB= . > I know I could do this with something like a perl script, making > connections to both DBs and transferring them over using select statement= s > in "beta_archive" and insert statements in the main DB. But is there a > better way, something inherent in PG SQL that allows me to do something > like this ? > > pg_dump / pg_restore are the core tools at your disposal. The ability to specify --inserts and --on-conflict-do-nothing on pg_dump in particular make at least attempting this against a copy of the backups quite appealing before trying to write a more targeted transfer script. David J. --000000000000b0456306508768ab Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Tue, Apr 28, 2026 at 8:56=E2=80=AFAM dfgpostgres <dfgpostgres3@gmail.com> wrot= e:

The managers tell me that they want to restore "beta&qu= ot; back to the main DB.=C2=A0
I know I could do this with something like a perl script, making= connections to both DBs and transferring them over using select statements= in "beta_archive" and insert statements in the main DB.=C2=A0 Bu= t is there a better way, something inherent in PG SQL=C2=A0that allows me t= o do something like this ?


pg_dump / pg_restore are the core tools at your disposal.= =C2=A0 The ability to specify --inserts and --on-conflict-do-nothing on pg_= dump in particular make at least attempting this against a copy of the back= ups quite appealing before trying to write a more targeted transfer script.=

David J.

--000000000000b0456306508768ab--