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 1tWZJN-00HYIt-3I for pgsql-general@arkaria.postgresql.org; Sat, 11 Jan 2025 11:05:49 +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 1tWZJL-008NQp-Nj for pgsql-general@arkaria.postgresql.org; Sat, 11 Jan 2025 11:05:47 +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 1tWZJL-008NQh-9G for pgsql-general@lists.postgresql.org; Sat, 11 Jan 2025 11:05:47 +0000 Received: from mail-yb1-xb35.google.com ([2607:f8b0:4864:20::b35]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tWZJH-001410-1S for pgsql-general@lists.postgresql.org; Sat, 11 Jan 2025 11:05:46 +0000 Received: by mail-yb1-xb35.google.com with SMTP id 3f1490d57ef6-e54d268bc3dso5124868276.1 for ; Sat, 11 Jan 2025 03:05:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736593542; x=1737198342; 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=nJ2rz0ZmwXx2YU+ausW3PoTXtOsWUp46Ui6bz3mdAfk=; b=mSgRPlie/nY8BDi0PuQWM3FqFGnjhDT8kid92bmECaA79snqX6ZD7u6lfHy1YwndDT SkX2s5cVDUEbecHGhN3clPhH00Wf02e1qhxMJmD7B+mbBM1YzY6vXzKOXenKtzE7Bwya 73iDe7P1e/rIq/D3FNXlF9KtYP5HbDJRleYGiCVTGcO+giRVsax5WBxtzhywk/3WYIhC vJ8GkY9yLb0VMGOgO+Dtzr2VMbPmoRDZGexr4bfurOPtVxrtGR6riQN6EExNhcVkBhQ7 MaORT0sySpKVlkczM7nN9gDDEtNLSESlaMdY+Ly2alOtJy0xyr8XO+4WKr6WSswgLPAM ntJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736593542; x=1737198342; 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=nJ2rz0ZmwXx2YU+ausW3PoTXtOsWUp46Ui6bz3mdAfk=; b=OcMc3CsDKBymBF4N/ErawgQehIlMgPdkJmRNomHJRZW8MFCBzHmOwkLqin/SZJ1Sha NkMmZTldqW3M5Jkj38Rw6t2R1FX7UhHIIvjg1SwH5Qu3Kr+m9IAsPYADmkFNz69laoq8 t1/JPGlQ+4TBelFZox4OGqIdnsInrvluKqFCcg35qpkBK4sruFV1dqmS7byeNAExURXo iC+wLYyeQBrzeMLGzMC0y4R6D1PCuPcwoiOnLjb0RcEpKgxHYW3B5t84HnbOXqwmMfrn mOmX79BIlbjYThD1wyC0G7vfwg+e6oHvOXJRcqniUt7sRpED9hW+OzJMUp+Zq17OHnGn YxeQ== X-Forwarded-Encrypted: i=1; AJvYcCXSa5aIDKq8FxXzfbW7benvgWaJgaI/9hjJhG6hR4SAsjlsibHNOwppX9SacxKQPAiasNF91PX+ftwwuh9K@lists.postgresql.org X-Gm-Message-State: AOJu0YxT5Syoyz/Hi8ccdW5utdXcrnaHrArqWc1oeLtP/Pn/d5A+3h6C +dEeG/v1BsQAUfdeHE2hGRkX2X92naaSXzfM060GJZzPEVDbLzpvCuFBpyO4vk2ioZkzdcjE5S7 ujbQdnCVOXQ6l+27QhC/UOEosMvQ= X-Gm-Gg: ASbGncviaNYXp1qkum/4uJFQKO2tY7ADwNHGpoIiXSCfAQf8SheR9ec2yCpaWjE4AoP 3jdZJKW1SSrazDtd29gibRHQI+KuLMeLFdR3W X-Google-Smtp-Source: AGHT+IHrOzEgeTHnd1/aZxOpUQP+qMdX0NA0oRnMnlLQE152WgQtPFYP2caHx6Sp3PM+RcXfPirbnAVfB3YVCDfNfUY= X-Received: by 2002:a05:6902:20c4:b0:e39:80b9:3344 with SMTP id 3f1490d57ef6-e54edf0d304mr10844523276.3.1736593542078; Sat, 11 Jan 2025 03:05:42 -0800 (PST) MIME-Version: 1.0 References: <10fe353b-a5ba-4522-badf-89119179b4f0@ewie.name> In-Reply-To: <10fe353b-a5ba-4522-badf-89119179b4f0@ewie.name> From: Andy Hartman Date: Sat, 11 Jan 2025 06:05:31 -0500 X-Gm-Features: AbW1kvZ0nf5wgoF8b9iWvlm15wweCq7JrHUmASllg3YMiC2d_D83NV6h25BtNjQ Message-ID: Subject: Re: Display Bytea field To: Erik Wienhold Cc: Ron Johnson , "pgsql-generallists.postgresql.org" Content-Type: multipart/alternative; boundary="00000000000031e810062b6c31a0" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000031e810062b6c31a0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 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 wro= te: > 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 > --00000000000031e810062b6c31a0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I used PS to pull the da= ta from mssql=C2=A0 to Postgres dumping data to csv. I then used csv to loa= d Postgres and the table that has Bytea

# Convert the image dat= a to a base64 string=C2=A0 -- powershell
=C2=A0 =C2=A0 $base64Ima= ge =3D [Convert]::ToBase64String($row.ImageSource)

AFter data was lo= aded the developer said in his app frontend that the Image wouldn't ope= n 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 image correctly appears...

C= ould that be caused by my PS dump to csv process or maybe still a code(fron= tend) issue..

Still tryi= ng to figure out using a single record if data loaded to the bytea field ma= tches 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 Fr= i, 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
--00000000000031e810062b6c31a0--