Subject: LOwrite BUG?

From: Wolf Guddat <[email-masked]>
Date: Fri, 8 Oct 93 15:44:19 MEZ

HI EVERYBODY! (especially the postgressors)

Postgres 4.1 (including a LO-patch from postgressors)
Ultrix 4.3
DECstation

About large objects, implemented via Inversion Files from user defined functions.

My problem is:

Assume the following function "input":

char *input (char *str)
{
   generate an inversion-filename "filename"
   create inversion file "filename"
   write str into inversion file
   close inversion file

   /* put new code here (see below) */

   return "filename"
}

Assume another function "conc":

char *conc (char *filename1, char *filename2)
{

   extract str1 which is written in inversion file filename1
   extract str2 which is written in inversion file filename2

   generate new filename "newfile"
   create inversion file "newfile"
   write str1 concatenated with str2 in the file "newfile"
   close "newfile"

   return "newfile"
}

What i want to do at the monitor is:

create S (s=char16) 
OK
append S (s= conc ("firststring"::char16, "secondstring"::char16) )  
NOT OK

Why is this not OK?
What is going on here, is the following:

Postgres calls 1. input("firststring")
	       2. input("secondstring")
	       and
	       3. passes the returned filenames into 
		  conc ("filename1", "filename2")
                  But oops: conc was not able to read the two files!
Amazing isn't it?

The solution is: 
If i insert a call to LOcreat at the position marked above , which creates a 
dummy file of no use then everything is OK.

It seems to me (not to say i'm sure) that this is another mysterious bug
in the large object managment. (Another has been explained in my mail from
yesterday).
Does this mean that after every LOwrite i have to do an LOcreat.

Any responses are welcome 

Bye Wolf

****************************************************
**                                                **
** Wolf Guddat, [email-masked] **
**                                                **
**       University of Erlangen/Nuernberg         **
**                     Germany                    **
**                                                **
**     Postgres 4.1, DECstation, ULTRIX 4.3       **
**                                                **
****************************************************