public inbox for [email protected]  
help / color / mirror / Atom feed
From: Ron Johnson <[email protected]>
To: pgsql-generallists.postgresql.org <[email protected]>
Subject: Re: Display Bytea field
Date: Sat, 11 Jan 2025 07:50:41 -0500
Message-ID: <CANzqJaAK9pSMbQh6e8LWVoGyqTHMW_3szEpspGO8JkkYQcq-tw@mail.gmail.com> (raw)
In-Reply-To: <CAEZv3cqQ-LRPLM8iMsKh_Wc023pdHiW34AeuuY9jH-OF8FUnqg@mail.gmail.com>
References: <CAEZv3co=t+YzkTmRMPR8Ev1izcb8VxYg-7jB2RCHSQGATsdHSg@mail.gmail.com>
	<CAEZv3copeUd7mNf98qxBtkqqW=g3MtCJe62jdMEEzFC4M=-+4A@mail.gmail.com>
	<CANzqJaDRQU2KsJt76TgPpES8qVg3i_sv5cZSmo=qoSN4VUzwNw@mail.gmail.com>
	<CAEZv3cqebrs+GT1YmWdk4sko7hgtstVKkcP+2OS07UtJ48x=dA@mail.gmail.com>
	<[email protected]>
	<CAEZv3cqQ-LRPLM8iMsKh_Wc023pdHiW34AeuuY9jH-OF8FUnqg@mail.gmail.com>

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 AM Andy Hartman <[email protected]>
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 = [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 PM Erik Wienhold <[email protected]> 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
>>
>

-- 
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!


view thread (12+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Display Bytea field
  In-Reply-To: <CANzqJaAK9pSMbQh6e8LWVoGyqTHMW_3szEpspGO8JkkYQcq-tw@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox