Re: Display Bytea field

2025-01-11 Thread Adrian Klaver

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 = [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 PM 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.kla...@aklaver.com





Re: Display Bytea field

2025-01-11 Thread Ron Johnson
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 
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  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 , and butter sauce.
Don't boil me, I'm still alive.
 lobster!


Re: Display Bytea field

2025-01-11 Thread Andy Hartman
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  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
>


Re: Display Bytea field

2025-01-11 Thread Andy Hartman
In mssql its a image datatype.

On Sat, Jan 11, 2025 at 7:08 PM Adrian Klaver 
wrote:

> On 1/11/25 15:49, 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
>
> You have not answered:
>
> What data type was used to store data in MySQL?
>
> Show command used to pull data from MySQL.
>
>
> >
> > "/9j/4AAQSkZJRgABAQAAAQABAAD
>
> Are you sure?
>
> The acceptable formats are shown here:
>
> https://www.postgresql.org/docs/current/datatype-binary.html
>
> And the above does not look like either.
>
>
>
>
> --
> Adrian Klaver
> adrian.kla...@aklaver.com
>
>


Re: Display Bytea field

2025-01-11 Thread Adrian Klaver

On 1/11/25 15:49, 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


You have not answered:

What data type was used to store data in MySQL?

Show command used to pull data from MySQL.




"/9j/4AAQSkZJRgABAQAAAQABAAD


Are you sure?

The acceptable formats are shown here:

https://www.postgresql.org/docs/current/datatype-binary.html

And the above does not look like either.




--
Adrian Klaver
adrian.kla...@aklaver.com





Re: Display Bytea field

2025-01-11 Thread Adrian Klaver

On 1/11/25 16:09, Andy Hartman wrote:

In mssql its a image datatype.


Oops, I was referring to the wrong database(MySQL) in previous posts.

So:

Show command used to pull data from MS SQL Server.



On Sat, Jan 11, 2025 at 7:08 PM Adrian Klaver > wrote:


On 1/11/25 15:49, 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

You have not answered:

What data type was used to store data in MySQL?

Show command used to pull data from MySQL.


 >
 > "/9j/4AAQSkZJRgABAQAAAQABAAD

Are you sure?

The acceptable formats are shown here:

https://www.postgresql.org/docs/current/datatype-binary.html


And the above does not look like either.




-- 
Adrian Klaver

adrian.kla...@aklaver.com 



--
Adrian Klaver
adrian.kla...@aklaver.com





Re: Display Bytea field

2025-01-11 Thread Andy Hartman
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 AM 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 = [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 PM 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.kla...@aklaver.com
>
>


Re: Display Bytea field

2025-01-11 Thread Ron Johnson
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 PM 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 AM 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 = [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 PM 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.
>> >
>>
>
-- 
Death to , and butter sauce.
Don't boil me, I'm still alive.
 lobster!