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 1tWlSE-001Sr1-IB for pgsql-general@arkaria.postgresql.org; Sun, 12 Jan 2025 00:03:47 +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 1tWlSD-00Dilh-PE for pgsql-general@arkaria.postgresql.org; Sun, 12 Jan 2025 00:03:45 +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 1tWlSD-00DilZ-AR for pgsql-general@lists.postgresql.org; Sun, 12 Jan 2025 00:03:45 +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.96) (envelope-from ) id 1tWlS9-0019Hl-1O for pgsql-general@lists.postgresql.org; Sun, 12 Jan 2025 00:03:44 +0000 Received: by mail-oo1-xc31.google.com with SMTP id 006d021491bc7-5f6497fbccbso2182201eaf.0 for ; Sat, 11 Jan 2025 16:03:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736640219; x=1737245019; 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=fIIvyZf3nzKhUN6GUelh9LKTEi7MOkv9p1ymsMKwTXc=; b=RBysBFkk3oWNOKwcNjMDcg/lisqGUTDYdnmzOQKEq2d0iuswwM0p+do70Uk0iGj6F0 N7GnN+uNYsEYOIOunShmUKJfuf23ILZFPVpV7gQ4xI7JA6wZLtDluL2s2Z7+7tizRbOv W4j6bWenMB5+XiNOhcmmYMb36TdueqovB9TuPcfWHD9W79iVdP4vjXHT3UB+plRYrh5p euD1upWRS/cihOdqZoUFZOUxUcHQEHlqFQN5b24MpXa4DPtEXcTTSkRSDT1sLdGS+uWB 00krQ9BEWj3b9iO0Qpz8neq8x78RlIu20PKliwXvVQ7JdPuhnCFcz8EnREBLcFhvA9DT JlXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736640219; x=1737245019; 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=fIIvyZf3nzKhUN6GUelh9LKTEi7MOkv9p1ymsMKwTXc=; b=qh8LcAzfaEyHz5UbEBVCZ7bZadTMKqA8k2Ro6A6kipix7Cxq8H7E6gKypzgBCh/vPT OrWqtpFZStK2WCfTjicQ4YxJzJhOczAf9JwumuJTuvMFca67rwcB4lNseVu7/O7pBRWV 98sO5SZORSJGOa4t69cRgQObaXlMIn+uNjZYH2XymWBl7b+d+zzVbb0zswNlZWB7+rdv 8Nycyi9US4xfh41biYk9GlmUL16rV+qmX/JxvvWyS6Bzb5ZO7AyHN1Wjcc07Ii6fNT2H 2uE7sR6dKqN5WCkMrNtVuB5WjvoMbH83yeGYLvBhCXtl/Yrp6mgynxuk4Oec/XA5Ou4T O/9Q== X-Gm-Message-State: AOJu0Yzsi38BqhAtcTzpfeXIL5uCXO4KNW6QwjfUpvsc94YP7bnq2K16 vqLS9f6/8EBC6Obf5RYn7jQf8RC0hlcAoLhu1RsrullZTw+3O4Oa4g90gfVVmFw/ZIeIx/pakcr W/+4d9mfMIIHKEM3Jo3jjjM8w5Pv5zA== X-Gm-Gg: ASbGncsA3QVB4P9SwL0g5fAWCIufZZX6lnGzgAj+bHAhSq7hEFPXb0fhn+7jn7Gz++g snDhIIwn3LcqA6trZsRCdcG7RIKWB14peo62E9JVUFg7Y29tBuCpf6UWi5eZrZPilRJEBpFkG X-Google-Smtp-Source: AGHT+IEufjhFndm3MHHonjDDQUQrjfPTTpj2aEgLvp32RZekZqShtwlgGCf+7T+CibwGxWtrN4hmMd09aYzBcAKKiPA= X-Received: by 2002:a05:6870:2dca:b0:29e:4b60:d992 with SMTP id 586e51a60fabf-2aae5daf209mr7230573fac.13.1736640218945; Sat, 11 Jan 2025 16:03:38 -0800 (PST) MIME-Version: 1.0 References: <10fe353b-a5ba-4522-badf-89119179b4f0@ewie.name> <9374c94f-95cc-4fa6-a997-a8fd7acdf379@aklaver.com> In-Reply-To: From: Ron Johnson Date: Sat, 11 Jan 2025 19:03:28 -0500 X-Gm-Features: AbW1kvbUuQWb6lrZ6PXIpEg_nvac34_h7sm62-1bcfVMlrjctbxJHgWqf05m2qw Message-ID: Subject: Re: Display Bytea field To: "pgsql-generallists.postgresql.org" , Andy Hartman Content-Type: multipart/alternative; boundary="0000000000005a5f02062b770f98" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000005a5f02062b770f98 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I bet Image*Source* doesn't contain what you think it does. I'd query that table using SSMS, to see what's really in that column. On Sat, Jan 11, 2025 at 6:49=E2=80=AFPM Andy Hartman wrote: > I still have csv files and loaded right into PG no decoding and look like > this little snippet and I did the COpy command into PG > > "/9j/4AAQSkZJRgABAQAAAQABAAD > > On Sat, Jan 11, 2025 at 11:50=E2=80=AFAM Adrian Klaver > wrote: > >> On 1/11/25 03:05, Andy Hartman wrote: >> > I used PS to pull the data from mssql to Postgres dumping data to csv= . >> > I then used csv to load Postgres and the table that has Bytea >> >> What data type was used to store data in MySQL? >> >> Show command used to pull data from MySQL. >> >> > >> > # Convert the image data to a base64 string -- powershell >> > $base64Image =3D [Convert]::ToBase64String($row.ImageSource) >> > >> > AFter data was loaded the developer said in his app frontend that the >> > Image wouldn't open thru his code. -- I'm trying to get that code to >> > help debug >> > >> > He said the size of the array is 1368. from bytea The size coming from >> >> How does an array enter into this? >> >> >> > the SQL-Server db is 46935 and the image correctly appears... >> > >> > Could that be caused by my PS dump to csv process or maybe still a >> > code(frontend) issue.. >> > >> > Still trying to figure out using a single record if data loaded to the >> > bytea field matches the mssql record. >> > >> > I tried to use the tool SimplySql to connect mssql to postgresql to >> > transfer data but it failed ... >> > >> > any help would be appreciated.. >> > > >> > On Fri, Jan 10, 2025 at 12:35=E2=80=AFPM Erik Wienhold > > > wrote: >> > >> > On 2025-01-09 21:31 +0100, Andy Hartman wrote: >> > > could it be done using Powershell? >> > >> > I use this: https://blog.cleverelephant.ca/2021/04/psql-binary.htm= l >> > >> > But I don't know if that translates to PowerShell. >> > >> > --=20 Death to , and butter sauce. Don't boil me, I'm still alive. lobster! --0000000000005a5f02062b770f98 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I bet ImageSource doesn't contain w= hat you think it does.=C2=A0 I'd query that table using SSMS, to see wh= at's really in that column.

On Sat, Jan 11, 2025 a= t 6:49=E2=80=AFPM Andy Hartman <hartman60home@gmail.com> wrote:
I still have cs= v files and loaded right into PG no decoding and look like this little snip= pet and I did the COpy command into PG=C2=A0

"/9j/4AAQSkZJRgABA= QAAAQABAAD

On Sat, Jan 11, 2025 at 11:50=E2=80=AFAM Adrian Klaver <= adrian.klave= r@aklaver.com> wrote:
On 1/11/25 03:05, Andy Hartman wrote:
> I used PS to pull the data from mssql=C2=A0 to Postgres dumping data t= o csv.
> I then used csv to load Postgres and the table that has Bytea

What data type was used to store data in MySQL?

Show command used to pull data from MySQL.

>
> # Convert the image data to a base64 string=C2=A0 -- powershell
>=C2=A0 =C2=A0 =C2=A0 $base64Image =3D [Convert]::ToBase64String($row.Im= ageSource)
>
> AFter data was loaded the developer said in his app frontend that the =
> Image wouldn't open thru his code. -- I'm trying to get that c= ode to
> help debug
>
> He said=C2=A0the size of the array is 1368. from bytea The size coming= from

How does an array enter into this?


> the SQL-Server db is 46935 and the image correctly appears...
>
> Could that be caused by my PS dump to csv process or maybe still a > code(frontend) issue..
>
> Still trying to figure out using a single record if data loaded to the=
> bytea field matches the mssql record.
>
> I tried to use the tool SimplySql to connect mssql to postgresql to > transfer data but it failed=C2=A0 ...
>
> any help=C2=A0would be appreciated..
=C2=A0

> On Fri, Jan 10, 2025 at 12:35=E2=80=AFPM Erik Wienhold <ewie@ewie.name
> <mailto:ewie@ew= ie.name>> wrote:
>
>=C2=A0 =C2=A0 =C2=A0On 2025-01-09 21:31 +0100, Andy Hartman wrote:
>=C2=A0 =C2=A0 =C2=A0 > could it be done using Powershell?
>
>=C2=A0 =C2=A0 =C2=A0I use this: https://b= log.cleverelephant.ca/2021/04/psql-binary.html
>=C2=A0 =C2=A0 =C2=A0<https://blog.clev= erelephant.ca/2021/04/psql-binary.html>
>=C2=A0 =C2=A0 =C2=A0But I don't know if that translates to PowerShe= ll.
>

--
Death to <Redacted>, and butter sauce.
Do= n't boil me, I'm still alive.
<Redacted> lobster= !
--0000000000005a5f02062b770f98--