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 1t1Cze-00FC15-PJ for pgsql-general@arkaria.postgresql.org; Wed, 16 Oct 2024 22:59:50 +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 1t1Czb-00BsQ2-NN for pgsql-general@arkaria.postgresql.org; Wed, 16 Oct 2024 22:59:48 +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 1t1Czb-00BsPt-8a for pgsql-general@lists.postgresql.org; Wed, 16 Oct 2024 22:59:47 +0000 Received: from mail-yb1-xb2a.google.com ([2607:f8b0:4864:20::b2a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1t1CzY-001G8c-Jp for pgsql-general@lists.postgresql.org; Wed, 16 Oct 2024 22:59:46 +0000 Received: by mail-yb1-xb2a.google.com with SMTP id 3f1490d57ef6-e297cc4b134so328290276.2 for ; Wed, 16 Oct 2024 15:59:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729119583; x=1729724383; darn=lists.postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=PDWzsDG2+NEUe6fn6/PPjg5zDWjQJt6QF7RbADuhOnw=; b=RQk9B9XheZnw6JcMgEB1Yj8uj3V75/A+0PN7GACL8tkk213mGRvQ4zsOY1tCTrRZ1d opJwwDgL4v25VQD93at5l8I4NPSQFNKnBII14RhE2ifs3u1RJfGYeCFCujbmua3bydn5 QeIs21j/LzrQJc7HCjfwBaXGR+jp64tMjIshjtW77seUAZQiSNiCW6DLzLYz5AX4c9nl 8y8JizVUw6Kj8MO2q+LIZMCaqj4k02I0AKbPUnNWnrNgEWA8rr13ccQ3A46vZog/5bAJ iaYFmLCcQZt/j1gGs+EkdJPBWGp9eeswyuqXSqOWAZsaTZP9hsgseqNSv09QPQl+7hgE 4NJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729119583; x=1729724383; h=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=PDWzsDG2+NEUe6fn6/PPjg5zDWjQJt6QF7RbADuhOnw=; b=o/dzswKajo5mIMkLYRZey5PTpXOHcAHjQ5mRMGT8LPtHU8HTzQpA1phVtthkWyuscl lX+TDo35SUnW1dPVLFPzXjCSckBc4YAMKM8agS/EvRLU6BldyrupOkPfufsqSeJtpAqT BIMcHFfPJUbU2RGOqJSUsEXy7fmpDCjBvu/DkMNQFlf4j0LalLVQNjlPRgQiFvlbSQYM Bd6kjaKY2ty6ZpVEM7B+pknszDZAbxF1Mib9f466Io0TTYU4CFFGSCoZi9GYJRUI1VPd V3Ei0HfkjcrYF/XpkgPQ4ImcKuE3CBbEA2ka/Tl+amzLGsjb0JI70U5KGz+MHWOddyJr VwGw== X-Gm-Message-State: AOJu0YxNp3Thjo6SPzwZFpEzk2bcRfMFl0dxPtP2P0Qv2PiikuXjbINO D/QC8Zccots86P7k6liuzrjDrWpLKaddwlTja90C4WQKVrrNCdETzCc4cE4LqcQzb0GEGKKl4Lc Z0zFCm3OY2t9Sg2h3rGb1FnYELx92UfYn X-Google-Smtp-Source: AGHT+IHW2/QKbuZ/o++9J9hpXBowd03HI0Uc+3KmXizob1if/N8ojMwP0sADMz0n3CLr7UZb9iCNOVvhA1R2CHDOc/4= X-Received: by 2002:a05:6902:280a:b0:e1f:e9b9:3d7c with SMTP id 3f1490d57ef6-e2931b391f9mr13439731276.18.1729119583189; Wed, 16 Oct 2024 15:59:43 -0700 (PDT) MIME-Version: 1.0 References: <20241016214847.yzfvfkvfnnlm2ba3@hjp.at> In-Reply-To: <20241016214847.yzfvfkvfnnlm2ba3@hjp.at> From: Andy Hartman Date: Wed, 16 Oct 2024 18:59:32 -0400 Message-ID: Subject: Re: Backup To: pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="00000000000087c2f50624a00610" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000087c2f50624a00610 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I'm on Ver16 and yes Our database has image in a bytea field. Running on Win22 box... On Wed, Oct 16, 2024 at 5:49=E2=80=AFPM Peter J. Holzer = wrote: > On 2024-10-16 16:02:24 -0400, Ron Johnson wrote: > > On Wed, Oct 16, 2024 at 4:00=E2=80=AFPM Achilleas Mantzios < > > a.mantzios@cloud.gatewaynet.com> wrote: > > =CE=A3=CF=84=CE=B9=CF=82 16/10/24 22:55, =CE=BF/=CE=B7 Ron Johnson = =CE=AD=CE=B3=CF=81=CE=B1=CF=88=CE=B5: > > On Wed, Oct 16, 2024 at 3:37=E2=80=AFPM Andy Hartman < > hartman60home@gmail.com> > > wrote: > [...] > > > > Step 1: redesign your DB to NOT use large objects. It's an old= , > slow > > and unmaintained data type. The data type is what you should > use. > > > > You mean bytea I guess. As a side note, (not a fan of LOs), I had t= he > > impression that certain drivers such as the JDBC support streaming > for LOs > > but not for bytea? It's been a while I haven't hit the docs tho. > > > > > > Our database is stuffed with images in bytea fields. The Java > application uses > > JDBC and handles them just fine. > > Images are usually small enough (a few MB) that they don't need to be > streamed. > > I don't think bytea can be streamed in general. It's just like text, you > write and read the whole thing at once. > > If you have data which is too large for that and want to store it in > bytea fields, you'll probably have to chunk it yourself (which you > probably have to anyway because for me "so large it has to be streamed" > implies "at least possibly larger than 1 GB"). > > hp > > -- > _ | Peter J. Holzer | Story must make more sense than reality. > |_|_) | | > | | | hjp@hjp.at | -- Charles Stross, "Creative writing > __/ | http://www.hjp.at/ | challenge!" > --00000000000087c2f50624a00610 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I'm on Ver16 and yes Our database has= =C2=A0 image in a bytea field.

Running= on Win22 box...

On Wed, Oct 16, 2024 at 5:49=E2=80=AFPM Peter J. Holz= er <hjp-pgsql@hjp.at> wrote:<= br>
On 2024-10-16 16= :02:24 -0400, Ron Johnson wrote:
> On Wed, Oct 16, 2024 at 4:00=E2=80=AFPM Achilleas Mantzios <
> a= .mantzios@cloud.gatewaynet.com> wrote:
>=C2=A0 =C2=A0 =C2=A0=CE=A3=CF=84=CE=B9=CF=82 16/10/24 22:55, =CE=BF/=CE= =B7 Ron Johnson =CE=AD=CE=B3=CF=81=CE=B1=CF=88=CE=B5:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0On Wed, Oct 16, 2024 at 3:37=E2=80=AF= PM Andy Hartman <hartman60home@gmail.com>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0wrote:
[...]
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Step 1: redesign your DB to NOT=C2=A0= use large objects.=C2=A0 It's an old, slow
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0and unmaintained data type.=C2=A0 The= data type is what you should use.
>
>=C2=A0 =C2=A0 =C2=A0You mean bytea I guess. As a side note, (not a fan = of LOs), I had the
>=C2=A0 =C2=A0 =C2=A0impression that certain drivers such as the JDBC su= pport streaming for LOs
>=C2=A0 =C2=A0 =C2=A0but not for bytea? It's been a while I haven= 9;t hit the docs tho.
>
>
> Our database is stuffed with images in bytea fields.=C2=A0 The Java ap= plication uses
> JDBC and handles them just fine.

Images are usually small enough (a few MB) that they don't need to be streamed.

I don't think bytea can be streamed in general. It's just like text= , you
write and read the whole thing at once.

If you have data which is too large for that and want to store it in
bytea fields, you'll probably have to chunk it yourself (which you
probably have to anyway because for me "so large it has to be streamed= "
implies "at least possibly larger than 1 GB").

=C2=A0 =C2=A0 =C2=A0 =C2=A0 hp

--
=C2=A0 =C2=A0_=C2=A0 | Peter J. Holzer=C2=A0 =C2=A0 | Story must make more = sense than reality.
|_|_) |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 |
| |=C2=A0 =C2=A0| hjp@hjp.a= t=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A0 -- Charles Stross, &q= uot;Creative writing
__/=C2=A0 =C2=A0| http://www.hjp.at/ |=C2=A0 =C2=A0 =C2=A0 =C2=A0challenge!&q= uot;
--00000000000087c2f50624a00610--