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 1t9664-007kmU-HF for pgsql-general@arkaria.postgresql.org; Thu, 07 Nov 2024 17:15:03 +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 1t9661-0001kr-Fa for pgsql-general@arkaria.postgresql.org; Thu, 07 Nov 2024 17:15:02 +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 1t9661-0001kf-3Y for pgsql-general@lists.postgresql.org; Thu, 07 Nov 2024 17:15:01 +0000 Received: from mail-oa1-x2e.google.com ([2001:4860:4864:20::2e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1t965z-000fHf-05 for pgsql-general@postgresql.org; Thu, 07 Nov 2024 17:15:00 +0000 Received: by mail-oa1-x2e.google.com with SMTP id 586e51a60fabf-28862804c9dso632596fac.0 for ; Thu, 07 Nov 2024 09:14:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730999698; x=1731604498; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=q5BWeflghLb9GwBbb7Y/80dpEMaCYdOZI4d8ZksWtpg=; b=E0q+uvqchB9fO18GM/GGkV/gQhHqJ7TXGzYsX5GTRnqpaO/cNJctVr2Vfii9NrZO/T ZWIGNxpNXM5XHchbdNyL/WuKYvrZJiNAPInH9O099YsntOv11hzd+hGXfbwdhRQiegq9 vQnPLVRGGldKky0XoRa/4QtXWF9Nao7KgqU8OFboN+Fgb/mtr0A1lrxbQccJnc4xzo3w nRQnCy3GcNyXGr1sM2EvlxmUy02vM5S24tcsm55pQIoKkwkDsWrKRNC6c97xRem63BPH RmvVUraUhTGRgdIGIuwgpJcYRRmHanHT8FtOUwbcW5kMDPROfg26kUD1lXI9GETmsaOk ixRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730999698; x=1731604498; h=content-transfer-encoding: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=q5BWeflghLb9GwBbb7Y/80dpEMaCYdOZI4d8ZksWtpg=; b=rjP+Ey+MOnxOcu/TpfOWMbGYYb08jJeVPmqxqLYvKWmbC7k+kJTQY80p+NNuYXP5Gj sfXVZisZVbo2cKatBXJaCObyvlplQC6ZrGzR7snsDg7cNfYosx/4G8u0vO5fG8oC2BNt OkUOLfSBD4d7wcI3W3ICRhsCe5cPmQlrGsarxRHQElnxW+WrN2HUgeivlQdpW3Wyr/E8 dJWigeAosgLJlTecKg9rMDo1IWmOnhFOXN7bwuxatdkGyTaYxPPKauG4nNPNAGNvAi1j 7lwzUsBDIbmQrMsVJSt9zaTyq+70ceVVG8jGChj1vnf9s9G+jOAaVDt45v1UmGNc0IHi vTkw== X-Gm-Message-State: AOJu0YxcIvbXI4GZ/k2Xb5jhLJj4sDsfg4HnSxkhAQLzsHnDg35Rr7kj yJbH5RdU2chI0ACZ8Ao8/TmT56iBpIGHlYcd42FRVDLHRGXDbkDkgwZtRVZmcSeGA9GUz/n4/qF 888gbeSgHCvCYdC7VqUV4v2dGPvNvNg== X-Google-Smtp-Source: AGHT+IE2TB+YN3qsHHKJ/s1xG90fZVO90sg31gRJRT+WRZp/L2Mt8DPEnw0H/XjMDzUmQg6UwJyz4XukW52dpGljAWI= X-Received: by 2002:a05:6871:451:b0:25e:b6d8:1754 with SMTP id 586e51a60fabf-2955c263a8fmr190019fac.1.1730999698018; Thu, 07 Nov 2024 09:14:58 -0800 (PST) MIME-Version: 1.0 References: <32fa25b0-7e5e-40d2-b3a8-e1cd1dbd833d@aklaver.com> In-Reply-To: <32fa25b0-7e5e-40d2-b3a8-e1cd1dbd833d@aklaver.com> From: Dominique Devienne Date: Thu, 7 Nov 2024 18:14:46 +0100 Message-ID: Subject: Re: About the stability of COPY BINARY data To: Adrian Klaver Cc: pgsql-general@postgresql.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Nov 7, 2024 at 5:37=E2=80=AFPM Adrian Klaver wrote: > > On 11/6/24 08:20, Dominique Devienne wrote: > >>From https://www.postgresql.org/docs/current/sql-copy.html: > > |> binary-format file is less portable across machine architectures > > and PostgreSQL versions > > > > In my experience, the binary encoding of binding/resultset/copy is > > endian neutral (network byte order), so what is the less portable > > across machine architectures that warning about? > > > > Also, does the code for per-type _send() and _recv() functions really c= hange > > across versions of PostgreSQL? How common are instances of such > > changes across versions? Any examples of such backward-incompatible > > changes, in the past? > > > > The binary data contains OIDs, but if sticking to built-in types, > > which OIDs are unlikely to change across versions? > > > > I'm obviously storing COPY BINARY data (we have lots of bytea > > columns), and I wonder how bad it is long term, and across PostgreSQL > > versions. > > If I where to hazard a guess this plays a part: > > https://www.postgresql.org/docs/current/sql-copy.html > > "To determine the appropriate binary format for the actual tuple data > you should consult the PostgreSQL source, in particular the *send and > *recv functions for each column's data type (typically these functions > are found in the src/backend/utils/adt/ directory of the source > distribution)." Hi Adrian. Well, sure. The questions above are whether those type-specific formats are= : 1) architecture dependent. (that's not my experience). 2) change across PostgreSQL versions. Not what the actual formats are. --DD PS: I'm surprised I didn't get answers. Seems to me to doc is overly "caref= ul" about COPY BINARY's stability, thus my asking for confirmation here.