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 1t96yX-007pQF-Nt for pgsql-general@arkaria.postgresql.org; Thu, 07 Nov 2024 18:11:21 +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 1t96yU-000qrP-W3 for pgsql-general@arkaria.postgresql.org; Thu, 07 Nov 2024 18:11:19 +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 1t96yU-000qr3-Kx for pgsql-general@lists.postgresql.org; Thu, 07 Nov 2024 18:11:19 +0000 Received: from mail-oo1-xc31.google.com ([2607:f8b0:4864:20::c31]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1t96yN-000iP8-3e for pgsql-general@postgresql.org; Thu, 07 Nov 2024 18:11:18 +0000 Received: by mail-oo1-xc31.google.com with SMTP id 006d021491bc7-5ebc0dbc566so661185eaf.3 for ; Thu, 07 Nov 2024 10:11:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731003070; x=1731607870; 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=PwF1U+FOuZm+f17GxniX+6O/eNJLjbql/5ZZ9nNYbI4=; b=kkOplCvPP7Nn0J7lZUqzGovh44rLHpotmSCbmrarGrD/+RCtTvCwWWzxQhHRYHOZav RvotLzEFoM4jfaSNiubvpl/vfXSxaCrbDnwrcmZr/tzOzvppvXRlvBlzNIARfs8TMRnp kfxQTVSBJhguzQf30VKnBGoU79bUpTcEXttY4tecEQ8uJYvhiogz7k5/LMQGSiTTICs+ MiB2IVhG974FHXWtb+9w67z1rGTfwhkCrk3q3Yqsl024KCrGXPAS87oFsjsNYjSaU4KH QKIX7N+upekQiIO7D/r4CcooZodQVaX6RVKMU2AI1RezfnGPcyPAdiZEhC0GhxjKXPLp sWxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731003070; x=1731607870; 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=PwF1U+FOuZm+f17GxniX+6O/eNJLjbql/5ZZ9nNYbI4=; b=UTzEt655pOyiXhHvMo8Q8174hdzLEDpWS5J+dEcmvvuulxSZXg2n8F3Wqm+YqsXuUV aVLPtMS0T0cHOt/u3Bv/nOJQhg8mWbupVamDacsJ2/QTx/l8CEb8XEquhLgwQuswHNTP 50nexThmfGkxVBGcoAd56pS2F7uJu1/zO41o/3gz1Q2a15UCmVkP0fyH3akvE9M+sizC LbpYHN+ygLGr5MNZNGq3lUchnerlN8+Fn5G1k5IIe2F8TppwwyZNqBBVt9+g0E2TecSg LHl/7pJCN0Y7Agb+I/7g9B98VBDaVXafSPdKKEQSJyGe5b6wzV/L4FSAYw2uBoxWyU82 IUYQ== X-Forwarded-Encrypted: i=1; AJvYcCUXJdj9NvcQstukYCVi/G85OWlN1hBaXx8T4XLqORiCEVS1I0Mv84BheC97Aeh1N58038F/vjdxbkgeG4WA@postgresql.org X-Gm-Message-State: AOJu0YwDAR28Kx6B1OCyQkrH6Wl8fvgC7eJbRL7ZP8TlNYBtCUICYsbT MwoJoLLDpkmiFsDdl48ATdFSUeQpjdyeDZtHb6xxwFFqf8j0jN2hvy3UguOK3H1Eqs2Z6dTykiY ug+pFO3S7EG0iQjLa4WLVVe7et3c= X-Google-Smtp-Source: AGHT+IGu2LDGsnhuOb3aIpuWEW+OacbdUQGxLWCAgfBiaA1yxOLlIyYnxxIc/n8zZHQ+oHVnB+s3W8PODc3CIepJEHY= X-Received: by 2002:a4a:e914:0:b0:5e5:b5d1:ee19 with SMTP id 006d021491bc7-5ee57c71da3mr18004eaf.8.1731003070325; Thu, 07 Nov 2024 10:11:10 -0800 (PST) MIME-Version: 1.0 References: <1214b740-22de-4151-a3c8-e93e3385c0da@manitou-mail.org> <5730b804-3544-4774-92dd-49954b720ac3@aklaver.com> In-Reply-To: <5730b804-3544-4774-92dd-49954b720ac3@aklaver.com> From: Dominique Devienne Date: Thu, 7 Nov 2024 19:10:59 +0100 Message-ID: Subject: Re: About the stability of COPY BINARY data To: Adrian Klaver Cc: Daniel Verite , 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 7:04=E2=80=AFPM Adrian Klaver wrote: > On 11/7/24 09:55, Dominique Devienne wrote: > > On Thu, Nov 7, 2024 at 6:39=E2=80=AFPM Daniel Verite wrote: > >> Dominique Devienne wrote: > >>> Also, does the code for per-type _send() and _recv() functions > >>> really change across versions of PostgreSQL? How common are > >>> instances of such changes across versions? Any examples of such > >>> backward-incompatible changes, in the past? > >> > >> For the timestamp types, I think these functions were > >> sending/expecting float8 (before version 7.3), and then float8 or > >> int64 depending on the server configuration up until 9.6, and since > >> then int64 only. > >> The same for the "time" field of the interval type. > >> There is still an "integer_datetimes" GUC reflecting this. > > > > Thanks. So it did happen in a distant past. > > Anything below 14 is of no concern to me though. > > So again, it does sound like changes are unlikely. > > Yeah that is implied by: > > https://www.postgresql.org/docs/current/pgupgrade.html > > "Major PostgreSQL releases regularly add new features that often change > the layout of the system tables, but the internal data storage format > rarely changes. " > > The COPY warning is there as heads up that it is a possibility. > > > > And I haven't seen anything not network-byte-order, > > as far architecture is concerned. But the COPY BINARY format and "the internal data storage format" are two separate things Adrian, AFAIK. Using binds and result sets in binary mode is part of the protocol in a way= , and not an internal implementation detail, like internal format for tables on disk. I'm sure I'm not the only one that using binary mode for PostgreSQL, and any change in _send and _recv functions across versions, or have their results be architecture dependent, would break many client codes, if it happened. And COPY BINARY's outer format is also public and documented, so can't change either. That's why I'm insisting on that phrase in the documentation, which gives the wrong impressions IMHO. Shouldn't it be removed or amended? Thanks, --DD