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 1tWlHX-001RUg-9T for pgsql-general@arkaria.postgresql.org; Sat, 11 Jan 2025 23:52:43 +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 1tWlHW-00Dekm-1O for pgsql-general@arkaria.postgresql.org; Sat, 11 Jan 2025 23:52:41 +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 1tWlEG-00DYyo-PC for pgsql-general@lists.postgresql.org; Sat, 11 Jan 2025 23:49:20 +0000 Received: from mail-yb1-xb35.google.com ([2607:f8b0:4864:20::b35]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tWlEE-00177X-12 for pgsql-general@lists.postgresql.org; Sat, 11 Jan 2025 23:49:19 +0000 Received: by mail-yb1-xb35.google.com with SMTP id 3f1490d57ef6-e53a91756e5so5692687276.1 for ; Sat, 11 Jan 2025 15:49:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736639357; x=1737244157; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=u/2512rr6sqU9duq/xxk73c09MMHxdej4aeSq65RPF8=; b=P0dPkxqWaB7Q+HSaHe9RlKrKAGpaNbYFPYuk0ZMOkVhNgCOojMXlJUdCVbNVtisVOb xX/au6GuGydV8RoLrfa5qFrVtnQuwUX57wKgmMdAfulM9kMxRH5mqkeMT4PeyPlZ0ng6 YVxNQiN6/oFoWu/j+e3JTC/7HsqqpR7Oaa6uIYgnjWL7YF6JblLbj16irVoUgiMx/NkJ pkoDxSICki1UsN4U8204XRw01ZdmYnDs4qnavfhYcgeXGYWLFSMMIhJ2+dciBnlTD4m6 BblDiu2HNs9ArEpyfpENLsLT5qB+U1re6TEi+DaZbsz/6Pk68E04wfAnaVvfmjJ3GdZN tiFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736639357; x=1737244157; h=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=u/2512rr6sqU9duq/xxk73c09MMHxdej4aeSq65RPF8=; b=FSMyn7On+roht8rSZCOg0MLO2yh1JA+rSxHBZMJxNW152lH59yPh9CIgbAngDKHLz8 +KhL0Iu6xdfbbGXF6aj64kOIDI2sg5N/kUN2YxowsBNKHqwJK2ukVr8E8KNOep3W0+Ok G3antTytCiZV3NqIV43tf2mMem0W11qB81uwIRSI3qmTh5p8GkIU706GxOzSiEDmKiH0 a7imr0jjWNTBsLJUl1HCk/84R2SGFHeQrFPl3fUTLlk0D9ty91IwoWgSOEd56AJrjQwe evpqUL6BPlHYgXpaMkCWBehp4G7LlL16F/hmhfIzcoO4m7zJFSxy+W8tF0VtgwVqtQ4l r+3w== X-Forwarded-Encrypted: i=1; AJvYcCXR7PZRtT/5z4VjZnJ2k6gvzkdTeLQPMy1nvw/b8EdVmDj+N94Df9LTL79RgN5QvEeAlhfOCceXOliXFHA+@lists.postgresql.org X-Gm-Message-State: AOJu0YwCb6Kwmz6Gx2kQJZ71/LikhLL6iPozyyuFA4QK8gC02Rwzg7GW 1g+mRtcU9Tn/nqvpd8YLplxsebiob5nbPxMdzRKXV+R+cgfiHY1CK4XHyi7nRMcXrxq9XWk7d3g pDkn1HKCDy3y2864FXKkjaiHnX6I= X-Gm-Gg: ASbGnctrq1Udw6BR1+4RMGwfMTgxhWe9myB08K7udACgqtyKeG81cXWfaad0cWkrx/B 5y6bfNx93AWtPhCwO3oC8W7dK9Wi8yPMeW6hs X-Google-Smtp-Source: AGHT+IGIUoA03/az3FXMp6Wx0bhs0lEwIOjMVmYarZQ31tY5Awbr6mmgIXmaiV7YgbTtR5Jdg6krsYaZMw5TfnYNtac= X-Received: by 2002:a05:6902:c02:b0:e4b:9367:dc1e with SMTP id 3f1490d57ef6-e54edf25f45mr10248623276.7.1736639357555; Sat, 11 Jan 2025 15:49:17 -0800 (PST) MIME-Version: 1.0 References: <10fe353b-a5ba-4522-badf-89119179b4f0@ewie.name> <9374c94f-95cc-4fa6-a997-a8fd7acdf379@aklaver.com> In-Reply-To: <9374c94f-95cc-4fa6-a997-a8fd7acdf379@aklaver.com> From: Andy Hartman Date: Sat, 11 Jan 2025 18:49:06 -0500 X-Gm-Features: AbW1kvaP7B-bjZbc7GZg2jHgxSWOFnLANlSKW851QlRdcbQxFJ-91EXxl2b6QZs Message-ID: Subject: Re: Display Bytea field To: Adrian Klaver Cc: Erik Wienhold , Ron Johnson , "pgsql-generallists.postgresql.org" Content-Type: multipart/alternative; boundary="000000000000029d5d062b76dc8c" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000029d5d062b76dc8c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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.html > > > > But I don't know if that translates to PowerShell. > > > > -- > > Erik Wienhold > > > > -- > Adrian Klaver > adrian.klaver@aklaver.com > > --000000000000029d5d062b76dc8c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I still have csv files and loaded right i= nto PG no decoding and look like this little snippet and I did the COpy com= mand into PG=C2=A0

"/9j/4AAQSkZJRgABAQAAAQABAAD

=
On Sat, Jan 11, 2025 at 11:50=E2=80=AFAM Adrian Klaver <adrian.klaver@aklaver.com> = wrote:
On 1/11/2= 5 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..
>
>
>
>
>
>
>
>
>
>
> 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.
>
>=C2=A0 =C2=A0 =C2=A0--
>=C2=A0 =C2=A0 =C2=A0Erik Wienhold
>

--
Adrian Klaver
adrian.klave= r@aklaver.com

--000000000000029d5d062b76dc8c--