Subject: Confusion over large objects.

From: M92 <[email-masked]>
Date: Tue, 6 Jul 93 05:47:12 -0700

I'm using the postgres large object facilities. However I'm becoming confused 
over the properties and differences between the two forms of large objects
supported by postgres.

I've defined a class with attributes which are unix large object ADTs, which 
have been defined using the functions lo_filein and lo_fileout for the type 
input and output functions, as suggested in the Reference Manual. However
there does not appear to be any large object identifiers generated when I append
instances of the large object ADTs to the class. The Reference manual suggests 
that large object identifiers should be assigned.

If I use the libpq command p_creat to create a unix large object then a large
object identifier is produced (LO*****, where ***** is an integer). However when
I use this command no matter what system path name I supply the large object
file is created within postgres. Thus data written to the large object is withinthe postgres file system and under the authority of the database administrator. My understanding of postgres large objects is that unix large objects are part 
of the unix file system and the data is not copied into postgres.

Could somebody please help in my understanding of large objects 

I'm also trying to use the LO* commands but the LO_read hangs-up when invoked. I
have a patch for the file inv_api.c but the systems administators are having
difficulty in getting the postgres build file to recognise that an update has 
occurred. Any suggestions about this problem would be gratefully received.

Thanks, Paul.

---

From: Mike Olson <[email-masked]>
Date: Tue, 06 Jul 1993 14:32:53 -0700

M92 <[email-masked]> writes:

> object identifier is produced (LO*****, where ***** is an integer). However w
  +hen
> file is created within postgres. Thus data written to the large object is wit
  +hinthe postgres file system and under the authority of the database administ
  +rator. My understanding of postgres large objects is that unix large objects
  + are part 
> of the unix file system and the data is not copied into postgres.

no, in either case the large object is copied into, owned by, and subject
to the control of the database system.  the difference is in how the
storage is managed -- as a unix file in the data/base/xxx directory,
or as a relation in the database.

> I'm also trying to use the LO* commands but the LO_read hangs-up when invoked
  +. I
> difficulty in getting the postgres build file to recognise that an update has
  + 
> occurred. Any suggestions about this problem would be gratefully received.

you could always do

	bmake clean ; bmake all

in src/backend.  this'll do what you want.  the bmake files correctly
manage dependencies in my experience, but this will force recompilation
in case it's not working for you.

can you send me your inv_api.c patch?  i'd like to take a look at it.

					mike