pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Large objects - SOS
3+ messages / 3 participants
[nested] [flat]

* Large objects - SOS
@ 2003-02-04 12:22 mjoseph@inautix.com
  2003-02-04 12:53 ` Re: Large objects - SOS Nigel J. Andrews <nandrews@investsystems.co.uk>
  2003-02-06 00:15 ` Re: Large objects - SOS Daniel Schuchardt <daniel_schuchardt@web.de>
  0 siblings, 2 replies; 3+ messages in thread

From: mjoseph@inautix.com @ 2003-02-04 12:22 UTC (permalink / raw)
  To: pgsql-admin; pgsql-novice@postgresql.org; pgsql-general@postgresql.org

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






^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Large objects - SOS
  2003-02-04 12:22 Large objects - SOS mjoseph@inautix.com
@ 2003-02-04 12:53 ` Nigel J. Andrews <nandrews@investsystems.co.uk>
  1 sibling, 0 replies; 3+ messages in thread

From: Nigel J. Andrews @ 2003-02-04 12:53 UTC (permalink / raw)
  To: mjoseph@inautix.com; +Cc: pgsql-admin; pgsql-novice@postgresql.org; pgsql-general@postgresql.org

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




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Large objects - SOS
  2003-02-04 12:22 Large objects - SOS mjoseph@inautix.com
@ 2003-02-06 00:15 ` Daniel Schuchardt <daniel_schuchardt@web.de>
  1 sibling, 0 replies; 3+ messages in thread

From: Daniel Schuchardt @ 2003-02-06 00:15 UTC (permalink / raw)
  To: pgsql-admin

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
> 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





^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2003-02-06 00:15 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-02-04 12:22 Large objects - SOS mjoseph@inautix.com
2003-02-04 12:53 ` Nigel J. Andrews <nandrews@investsystems.co.uk>
2003-02-06 00:15 ` Daniel Schuchardt <daniel_schuchardt@web.de>

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