Return-Path: postman 
Delivery-Date: Fri, 08 Oct 93 07:52:18 PDT
Return-Path: postman
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA15081; Fri, 8 Oct 93 07:43:52 -0700
Resent-From: postman (POSTGRES mailing list)
Resent-Message-Id: <9310081443.AA15081@postgres.Berkeley.EDU>
Sender: owner-postman@postgres.Berkeley.EDU
X-Return-Path: guddat@faps.uni-erlangen.de
Received: from faui45.informatik.uni-erlangen.de by postgres.Berkeley.EDU (5.61/1.29)
	id AA15073; Fri, 8 Oct 93 07:43:43 -0700
Received: from behaim.faps.uni-erlangen.de by uni-erlangen.de with SMTP;
	id AA00752 (5.65c-5/7.3v-FAU); Fri, 8 Oct 1993 15:44:47 +0100
Received: from faber.faps.uni-erlangen.de by faps.uni-erlangen.de with SMTP;
	id AA16611 (16.8/7.3s-FAU); Fri, 8 Oct 93 15:44:36 +0100
From: Wolf Guddat <guddat@faps.uni-erlangen.de>
Message-Id: <9310081444.AA16611@behaim.faps.uni-erlangen.de>
Subject: LOwrite BUG?
To: postgres@postgres.berkeley.edu
Date: Fri, 8 Oct 93 15:44:19 MEZ
Mailer: Elm [revision: 70.30]
Resent-To: postgres-dist
Resent-Date: Fri, 08 Oct 93 07:43:51 PDT

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, guddat@faber.faps.uni-erlangen.de **
**                                                **
**       University of Erlangen/Nuernberg         **
**                     Germany                    **
**                                                **
**     Postgres 4.1, DECstation, ULTRIX 4.3       **
**                                                **
****************************************************

