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 1tWax8-000ARx-Av for pgsql-general@arkaria.postgresql.org; Sat, 11 Jan 2025 12:50:58 +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 1tWax6-0093Nz-VD for pgsql-general@arkaria.postgresql.org; Sat, 11 Jan 2025 12:50:56 +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 1tWax6-0093Nq-GY for pgsql-general@lists.postgresql.org; Sat, 11 Jan 2025 12:50:56 +0000 Received: from mail-oa1-x36.google.com ([2001:4860:4864:20::36]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tWax4-0012bn-00 for pgsql-general@lists.postgresql.org; Sat, 11 Jan 2025 12:50:55 +0000 Received: by mail-oa1-x36.google.com with SMTP id 586e51a60fabf-29fe7ff65e6so1023638fac.0 for ; Sat, 11 Jan 2025 04:50:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736599853; x=1737204653; 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=lefYXPETHCenaL23g4G5ZboCh+xli6qUMV7oQaGINNQ=; b=LdvwvqhvaJAXCbKHLvinzWFd7PG4IpF1xRZl+562GxH6xicRumJbsPWOznizMcEDsG utR6bhk5Yps/60b/zGC43h/B1ZGx+t7RfjkqO9PlrddBf4gp/PBbXYC7ypdcxe5UdVFo ZRdeGu4mko4QxZ8jL3v+Xccb+X0PuEjo2dOa4h0iNVdiyeiCM6ij+YjO3urwSyWrFaq+ eJsvdK8BYtJvz1bUfHTBLiYzC1fz9WalFZcgKb+Q/5vvKIdR32auQnYXeAKm+s43jTHz /7AWIcm3bojtq8OrHBfq7WWm62JvHQ+aHfyCNR2RRvrp1OvRZfwH27xVOlvHUUPlAvF7 9m8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736599853; x=1737204653; 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=lefYXPETHCenaL23g4G5ZboCh+xli6qUMV7oQaGINNQ=; b=ZF54iCniBaZMpejcTWBJktAQl5XO41kFWLTSsgsbmAE6LO0l7suLpRehz3z3TK024b KW8wNnFFWpXhpOMxU6tM74U7suPY8zRMG5tbzswXJdgfZoI0lEH5A6WoDCAFIpVYSfAo L+W29+nUvUOYl9mexo55TVQEa9VC8G/tp5BMIO5/0YIPfzMO2oMv0Q5hXv+u7P2cA9AV s8Kc7em5tKCN/8LGBhzrb6aPf8oGi/9T6tmM71M9bhLvFNh8aKpyNmznSDb1T3Oy0/QC 8qqQ2G8WgVJVgYoEp/XE+6JY9KXu5bliadifsgx7m7fz36PCkSut6SiG+B0YVRKDqHhA RTWQ== X-Gm-Message-State: AOJu0Yx3yh5kMzo7AxIBJBu7UaSHDMF68DI87fAeHXh+csbzZhY6F2V1 gh8zvS4e91J0DwkWhiyPHqNnAXwC6o3rBGWJ1Ngva4eoGHoc2dvQodefX3I7pE+CRw6eRdC6QhJ tuM5IedLHse5UDg2Df/JcqRrksyFtVg== X-Gm-Gg: ASbGnctkw3klJujaLbGRM7GonkpYgRMv9gyc0zsgAwQOQcDtyqcUPp7PFv4GfyGdmKB mqAPb5DvT7Eh9zlDg7M88fSja02uiy2YQ+mR3NTc= X-Google-Smtp-Source: AGHT+IFG0OlhcIIhheL/RJY0EkhqbszPritlhN/zLgUx5Brmu3Jrf6vJzPD7+Z1CusYeSV7WRncOLYuTbEmyhqUHYFU= X-Received: by 2002:a05:6871:5387:b0:29e:20c4:2217 with SMTP id 586e51a60fabf-2aa06922fbcmr8367263fac.33.1736599852281; Sat, 11 Jan 2025 04:50:52 -0800 (PST) MIME-Version: 1.0 References: <10fe353b-a5ba-4522-badf-89119179b4f0@ewie.name> In-Reply-To: From: Ron Johnson Date: Sat, 11 Jan 2025 07:50:41 -0500 X-Gm-Features: AbW1kvZA7kQ8RYv3mt53brcqyGM5aqrfFaulfgKYvpJLj4yDThooIaTPpDMNYfQ Message-ID: Subject: Re: Display Bytea field To: "pgsql-generallists.postgresql.org" Content-Type: multipart/alternative; boundary="0000000000004ff8cc062b6da915" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000004ff8cc062b6da915 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 1. Do you still have the CSV file (or can you regenerate it from the still-existing MSSQL DB)? 2. Did you load the base64 string into PG, or did you decode before loading into PG? 3. A base64 string would be about 62KB. Either you did something wrong when loading, or the programmer is doing something wrong. 4. When I migrated from Oracle LOBs to PB bytea, the Perl program ora2pg generated CSV files with "hex" strings for those columns. They were preceded by "\x", I think. They loaded directly into the PG database, with the COPY command. On Sat, Jan 11, 2025 at 6:05=E2=80=AFAM 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 > > # 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 th= e > 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 w= rote: > >> 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 >> > --=20 Death to , and butter sauce. Don't boil me, I'm still alive. lobster! --0000000000004ff8cc062b6da915 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

1. Do you still have the CSV file (or = can you regenerate it from the still-existing MSSQL DB)?
2. Did y= ou load the base64 string into PG, or did you decode before loading into PG= ?
3. A base64 string would be about 62KB.=C2=A0 Either you did so= mething wrong when loading, or the programmer is doing something wrong.
4. When I=C2=A0migrated from Oracle LOBs to PB bytea, the Perl progr= am ora2pg generated CSV files with "hex" strings for those column= s.=C2=A0 They were preceded by "\x", I think.=C2=A0 They loaded d= irectly into the PG database, with the COPY command.

On Sat, Jan 11, 2025 at 6:05=E2=80=AFAM Andy Hartman <hartman60home@gmail.com> wro= te:
I used PS to pull the data from mssql=C2=A0 to Postgres dumping da= ta to csv. I then used csv to load Postgres and the table that has Bytea
# Convert the image data to a base64 string=C2=A0 -- powershell
=C2=A0 =C2=A0 $base64Image =3D [Convert]::ToBase64String($row.Imag= eSource)

AFter data was loaded the developer said in his app fronten= d that the Image wouldn't open thru his code. -- I'm trying to get = that code to help debug

He said=C2=A0the size of the array is = 1368. from bytea The size coming from the SQL-Server db is 46935 and the im= age correctly appears...

Could that be caused by my PS dump to csv p= rocess or maybe still a code(frontend) issue..

<= /span>
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 ...=C2=A0

any help=C2=A0would be appreciated..








=

On Fri, Jan 10, 2025 at 12:35=E2=80=AFPM Erik Wienhold <ewie@ewie.name> wrote:
=
On 2025-01-09 21:31= +0100, Andy Hartman wrote:
> could it be done using Powershell?

I use this: https://blog.cleverelephant.ca/20= 21/04/psql-binary.html
But I don't know if that translates to PowerShell.

--
Erik Wienhold


--
Death to <Redacted>, and butter sauce.Don't boil me, I'm still alive.
<Redacted> lobs= ter!
--0000000000004ff8cc062b6da915--