Large objects - SOS

Started by Nonameabout 23 years ago3 messagesgeneral
Jump to latest
#1Noname
mjoseph@inautix.com

Hi,
I need to create a large object - a photograph and work with it. I would be
using ODBC (application on Windows NT , db server on Linux)
The doc at
http://gborg.postgresql.org/project/psqlodbc/faq/faq.php?faq_id=52
suggests creating a custom type like this.
create type lo (
internallength=4,
externallength=10,
input=int4in,
output=int4out,
default='',
passedbyvalue
);

I need to define the input & output functions (int4in and int4out).
Can someone give me a clue as to how these functions should be defined?
Some sample code would really help me.

Regards,
Manoj

#2Nigel J. Andrews
nandrews@investsystems.co.uk
In reply to: Noname (#1)
Re: Large objects - SOS

On Tue, 4 Feb 2003 mjoseph@inautix.com wrote:

Hi,
I need to create a large object - a photograph and work with it. I would be
using ODBC (application on Windows NT , db server on Linux)
The doc at
http://gborg.postgresql.org/project/psqlodbc/faq/faq.php?faq_id=52
suggests creating a custom type like this.
create type lo (
internallength=4,
externallength=10,
input=int4in,
output=int4out,
default='',
passedbyvalue
);

I need to define the input & output functions (int4in and int4out).
Can someone give me a clue as to how these functions should be defined?
Some sample code would really help me.

If it were up to me I would base64 encode the data and store it in a bytea type
column. Obviously retrieval involves decoding the base64. Note though, using
the database functions to encode/decode the data defeats the object of the
encoding, which is to avoid all possible special character interpretion by the
parser (and possibly the wire protocol).

As I understand it, bytea should mostly work without encoding the data if you
can quote the data correctly. However, my very quick experiments didn't work
first time so I advised the client to go the easy route. I hope to revisit this
my self again soon (when I get the time).

--
Nigel J. Andrews

#3Daniel Schuchardt
daniel_schuchardt@web.de
In reply to: Noname (#1)
Re: Large objects - SOS

Hi, in 7.3 this changed.

type :

CREATE DOMAIN lo AS oid;

And everything works well.

Daniel

<mjoseph@inautix.com> schrieb im Newsbeitrag
news:OF0B8A93EA.20F6C498-ON65256CC3.0043C73A@LocalDomain...

Hi,
I need to create a large object - a photograph and work with it. I would

be

Show quoted text

using ODBC (application on Windows NT , db server on Linux)
The doc at
http://gborg.postgresql.org/project/psqlodbc/faq/faq.php?faq_id=52
suggests creating a custom type like this.
create type lo (
internallength=4,
externallength=10,
input=int4in,
output=int4out,
default='',
passedbyvalue
);

I need to define the input & output functions (int4in and int4out).
Can someone give me a clue as to how these functions should be defined?
Some sample code would really help me.

Regards,
Manoj

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org