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 1uKuWn-00EA2w-Jh for pgsql-admin@arkaria.postgresql.org; Fri, 30 May 2025 07:51:45 +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 1uKuWl-00GTX3-0R for pgsql-admin@arkaria.postgresql.org; Fri, 30 May 2025 07:51:43 +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 1uKuWk-00GTWt-LA for pgsql-admin@lists.postgresql.org; Fri, 30 May 2025 07:51:42 +0000 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uKuWh-000qpa-1u for pgsql-admin@lists.postgresql.org; Fri, 30 May 2025 07:51:41 +0000 Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-310cf8f7301so1430461a91.1 for ; Fri, 30 May 2025 00:51:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1748591497; x=1749196297; darn=lists.postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=bDvKNQLWWqQcqy1zGEe2QxIWA2SdEo6EGmn9YruaPa0=; b=QJ9QjGuzGWTaWW0P9AgysPt7mboJcStsSNYFy7hTYflsWZR+97U6N+z90OVHNrDric HfmVmQlXO9GX1VB4+9XfrcQm9BxUMwWz65aIEQnGAnC7grQzGAQaDDiijqV7+wBhgKp9 9QJ/t07lcDaT5Gg70BnXd91ZkLuJDVnDfIca3dv3fDHD/wxdTRcmzExjGdQKQcK16U+L OJ6z+xXCyUV4WnphJx7IoUvOJ22BcElb6dOTyfIHsVEkFvu+lzjEe3diVgivPTGSEoT1 ga394Z793w4QHjGA1PHoqZbJpLNrMj7ZVk8kZAfz18QSSp/F77eRbCabXNAVHxMYBeVd +8fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748591497; x=1749196297; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=bDvKNQLWWqQcqy1zGEe2QxIWA2SdEo6EGmn9YruaPa0=; b=oI95qd5udMLNjaVD8Nm020/EhvNTXhm6UgIprkBEpZtbhp8D+ZUuhE+Nbr+/Fwr/kL OXrEIxl2iH0pYlOmzgxmam5PMjFsCGOiFU270yCOX3Pj1zQn9cQdJNGFpMtNOKglM1d9 7Qs+zbLEiH9W2siY9bnMVua2EuQLs/VsdwsVPACX6UfdXMlB+TK1cyYAs8ui8vMCmsXO HtI3LqiABsDeI9rZ2ZJH5z8tbWqEseCXimXCo7B+JZhyiEt89EqWDRsvDH73p3/9OE2C DJxr5fQQnQzyjZSlgno5L4a4Zs0psQjTnB4BQggIf97exxGgF3UGidPi11X39XKuKY5q v8Kw== X-Gm-Message-State: AOJu0YyxjHn3bfRuQRcGf6qrbqm03oCEfRhecwLm5SHzImx6wIWVx8dK itXVOU8q84xOaK4dbUUH0ImQwhHNNT1bXIOKnO6g3qQRQVs3mOJB0suaFnqwXbBs3g80X0PNIB3 MYl3A6mgkSrKC7KV+g4xwsTbAOTgsR578bg== X-Gm-Gg: ASbGnctuDVb21PpfcvqhP+IqXh5r3yY0wCsppZ1rcIcIsiYvseGHHijmGGWG+vqOwGu DC8KtRlJruooqIpnGeScRwByHD7lU5VecRMUgTt740EyVcvHUzQ4sk9BofKo4yqZWfr/ZJuE1K3 qOBFXHJ30d1wyBgxwljROwcJ3E/vPdU04= X-Google-Smtp-Source: AGHT+IFltf2/0ldU19wOqpWAuJozhF1wdZgaLdrbLW+FPwTsA+a56KTNhhjJn6bVLj3imunTzixo2ustCHskVroV7/k= X-Received: by 2002:a17:90b:388a:b0:2fa:42f3:e3e4 with SMTP id 98e67ed59e1d1-31214e13ba8mr8495011a91.3.1748591496831; Fri, 30 May 2025 00:51:36 -0700 (PDT) MIME-Version: 1.0 From: Motog Plus Date: Fri, 30 May 2025 13:21:25 +0530 X-Gm-Features: AX0GCFu2jhG0RqXr_-ehnNtwRg1BQ9GSlh05PfOA6S3C5Cfm0Zj0CUEtcSHC4GY Message-ID: Subject: Seeking Suggestions for Best Practices: Archiving and Migrating Historical Data in PostgreSQL To: Pgsql-admin Content-Type: multipart/alternative; boundary="00000000000006a744063655af4e" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000006a744063655af4e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Team, We are currently planning a data archival initiative for our production PostgreSQL databases and would appreciate suggestions or insights from the 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 ongoin= g 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 --00000000000006a744063655af4e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Team,

We = are currently planning a data archival initiative for our production Postgr= eSQL databases and would appreciate suggestions or insights from the commun= ity 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 arc= hived data should be moved to a separate PostgreSQL database (on a same or = different server).
- Our goals are: efficient data m= ovement, minimal downtime, and safe deletion from the source after successf= ul archival.

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

We explo= red using `COPY TO` and `COPY FROM` with CSV files, uploaded to a SharePoin= t or similar storage system. However, our infrastructure team raised concer= ns around the computational load of large CSV processing and potential secu= rity implications with file transfers.

We=E2=80=99d like to understand:
- Wh= at approaches have worked well for you in practice?
= - Are there specific tools or strategies you=E2=80=99d recommend for ongoin= g archival?
- Any performance or consistency issues = we should watch out for?

Your insights or any relevant documentation/pointers would be immensely he= lpful.

Thanks in advance= for your guidance!

Best= regards,=C2=A0=C2=A0
Ramzy
--00000000000006a744063655af4e--