Re: [Solved] SQL Server to PostgreSQL - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: [Solved] SQL Server to PostgreSQL
Date
Msg-id 39A3B79D.400546CA@cupid.suninternet.com
Whole thread Raw
In response to RE: [Solved] SQL Server to PostgreSQL  (Franck Martin <Franck@sopac.org>)
List pgsql-general
Franck Martin wrote:
>
> As we are talking about 7.1 and huge field size...
>
> MS-SQL has a function that allows you to retreive part of a field a kind of
> mid$(field, start, length). This would be a good addition indeed.

does substr() not handle this?

> last problem. PG does not allow to store binary data. I'm not talking about
> the current implementation of BLOB, but what will happen in 7.1...
>
> If I want to store an image in a field. I cannot do that in 7.1 because the
> data sent by 7.1 and received in libpq must be formated in ASCII. I haven't
> play around to see if I could create a user type called varbinary(n), which
> will output via varbinary_out just the content of a buffer... May be varchar
> does it already (even if there is a \0?).

One thing I've thought about is creating an escape char to delimit this
sort
of thing. Maybe a control-A, followed by four bytes giving the length
followed
by that many byes of data. Escape \0's with ^A0 and a real ^A with ^A^A.

I would love something like this because I always get tripped up by
fields
I'm inserting containing quotes and other characters that need to be
escaped.

> I know I should submit this problem to the hacker list, but I don't want to
> subscribe to hacker just to submit one message...

Heh, I know what you mean...

--
Martijn van Oosterhout <kleptog@cupid.suninternet.com>
http://cupid.suninternet.com/~kleptog/

pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: DateStyle causes drama during upgrade
Next
From: "jeff seaman"
Date:
Subject: windows supported platforms