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 1uKx05-00F4zc-Ma for pgsql-admin@arkaria.postgresql.org; Fri, 30 May 2025 10:30: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 1uKx04-0008Ih-Dt for pgsql-admin@arkaria.postgresql.org; Fri, 30 May 2025 10:30:08 +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 1uKx04-0008IZ-1X for pgsql-admin@lists.postgresql.org; Fri, 30 May 2025 10:30:08 +0000 Received: from mail-yb1-xb31.google.com ([2607:f8b0:4864:20::b31]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uKx02-000h55-0t for pgsql-admin@lists.postgresql.org; Fri, 30 May 2025 10:30:07 +0000 Received: by mail-yb1-xb31.google.com with SMTP id 3f1490d57ef6-e7f7d5ff805so1066421276.1 for ; Fri, 30 May 2025 03:30:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1748601005; x=1749205805; darn=lists.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=oc9u6599G8bYOkny2D4c2EHaq3UIoBFIn50ODMDYtI8=; b=Ud+Qgswqn1OfvVEfFTxpSxp1PueiYT7yHSkR+eiuC8Gg5zvOH7ZrJj6VizCtu42vTN gvyb0j2ZYl8GoLDGAdBB8eOF8yMiOSuJlkFzt41FxtVse9OVc+0xYMHmNo1JnLwkYBi+ sVWdX3Ueqe8unT1SH+JevR4lfuR3zcKwOZEJEES+LSyMucmfQKlOZa2i4nV7bgP/DWWj HUjbVU+Hj6Byw5muZF1kLRRsniyPZYpZEGdR0C1K21L2ajEaqg0jhibmf3xc4eki1vqi 6N4wOzyA0632K0o9+M/nde4pY2AlxK4yVBjWYIV/sXqj5tYo3sxv2MeEZAyqTpmBKgGq nFsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748601005; x=1749205805; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=oc9u6599G8bYOkny2D4c2EHaq3UIoBFIn50ODMDYtI8=; b=HBVl1g1LEq38UVKvbag4l/syMZCxaBUDCp85hSwlS93oMQS9hfgs4fJFbXm/gI9V63 2ANMMZ0NwbMrb1JJ2JygiBp7du5NtlI87lKrXroMF5iMRJDWzjz4dSboeca6hQBlhE3T tOzRxTxBEX6OlTIo8FlN0kkWoK/9nl/Wty5Jwmvk9jbN0m/qNnsM2a+hatpJir3bgkYF eqrLSQLx/etb/fIDWP2Ie41rq060Asykqwqor4TYAYvXGocbq2rQsUbJkNq+OZkL1Glm VrA1c5fS/fssFz2W4sziiyk7KCSa6QLjVyAxMEYXStOjrNUZQRo50CSXbsI2bYIC2ISD LJDQ== X-Gm-Message-State: AOJu0Yyu0kzcYVyNDMHHzRxgNDF/4q2c0qqqAvNqBl71EXaSys8rTocZ 7Jn9u+9fBclwgSBBVFCMkLnvPFlxm4t9qSzOllLq7LH0+/Csz8fn5+Yd+g93JL3iP/8jnBFV9tq 51hRGveboZ/qFj+tkYk76zjiXWsgL3AM= X-Gm-Gg: ASbGncuTVj7MUCQYnrRtFQZ2WYlTZP8wGAZvIoRf1cIEkh5x12eUUww3Tk45dGadWxu c3Xcr5GajjMgy5MqXlbdfBhKMAGcb8D2YZXEZYH7tCOv0hBnIv1PMZ5m+JCzO3f9e1PouI5KHLX gagUJsJx/eUTrYjKHRRet9Hx6E9VP3cSdR X-Google-Smtp-Source: AGHT+IEKjPHjSdARWxVII53K10sz0rAwy/gGXMmRYqGgvhki9jIqrJohC6ozkDS5Hb5nss0kWSGveJ+bcpltEruT76M= X-Received: by 2002:a05:6902:1243:b0:e7b:9220:d39b with SMTP id 3f1490d57ef6-e7f81f135d3mr3720669276.41.1748601005331; Fri, 30 May 2025 03:30:05 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Andy Hartman Date: Fri, 30 May 2025 06:29:54 -0400 X-Gm-Features: AX0GCFuAav4_9XZTttLA_6iQomM6moEwgUMEovatYV5hdlZQ1NsvlXejojMXkKA Message-ID: Subject: Re: Seeking Suggestions for Best Practices: Archiving and Migrating Historical Data in PostgreSQL To: Motog Plus Cc: Pgsql-admin Content-Type: multipart/alternative; boundary="000000000000c6dbe9063657e5f1" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000c6dbe9063657e5f1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I have the same situation and am very curious about a long term solution people are using. On Fri, May 30, 2025 at 3:51=E2=80=AFAM Motog Plus wr= ote: > Hi Team, > > We are currently planning a data archival initiative for our production > PostgreSQL databases and would appreciate suggestions or insights from th= e > community regarding best practices and proven approaches. > > **Scenario:** > - We have a few large tables (several hundred million rows) where we want > to archive historical data (e.g., older than 1 year). > - The archived data should be moved to a separate PostgreSQL database (on > a same or different server). > - Our goals are: efficient data movement, minimal downtime, and safe > deletion from the source after successful archival. > > - PostgreSQL version: 15.12 > - Both source and target databases are PostgreSQL. > > We explored using `COPY TO` and `COPY FROM` with CSV files, uploaded to a > SharePoint or similar storage system. However, our infrastructure team > raised concerns around the computational load of large CSV processing and > potential security implications with file transfers. > > We=E2=80=99d like to understand: > - What approaches have worked well for you in practice? > - Are there specific tools or strategies you=E2=80=99d recommend for ongo= ing > archival? > - Any performance or consistency issues we should watch out for? > > Your insights or any relevant documentation/pointers would be immensely > helpful. > > Thanks in advance for your guidance! > > Best regards, > Ramzy > --000000000000c6dbe9063657e5f1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I have the same situation=C2=A0and am very curious about a= long term solution people are using.

On Fri, May 30, = 2025 at 3:51=E2=80=AFAM Motog Plus <mplus7535@gmail.com> wrote:
Hi Team,

We are currently planning a data archival initiative for= our production PostgreSQL databases and would appreciate suggestions or in= sights from the community regarding best practices and proven approaches.

**Scenario:**
- We have a few large tables (several hundred million rows) whe= re we want to archive historical data (e.g., older than 1 year).
- The archived data should be moved to a separate PostgreSQL d= atabase (on a same or different server).
- Our goals= are: efficient data movement, minimal downtime, and safe deletion from the= source after successful archival.

- PostgreSQL version: 15.12
- Both source= and target databases are PostgreSQL.

We explored using `COPY TO` and `COPY FROM` with CSV files, u= ploaded to a SharePoint or similar storage system. However, our infrastruct= ure team raised concerns around the computational load of large CSV process= ing and potential security implications with file transfers.

We=E2=80=99d like to understand:
- What approaches have worked well for you in practice?<= /div>
- Are there specific tools or strategies you=E2=80= =99d recommend for ongoing archival?
- Any performan= ce or consistency issues we should watch out for?
Your insights or any relevant documentation/point= ers would be immensely helpful.

Thanks in advance for your guidance!

<= /div>
Best regards,=C2=A0=C2=A0
Ram= zy
--000000000000c6dbe9063657e5f1--