Return-Path: pg_adm@postgres.berkeley.edu
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA01596; Thu, 13 May 93 08:21:13 -0700
Message-Id: <9305131521.AA01596@postgres.Berkeley.EDU>
From: Wolf Guddat <guddat@faps.uni-erlangen.de>
Subject: VARLENATT
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu
To: postgres@postgres.berkeley.edu
Date: Thu, 13 May 93 17:20:26 MESZ
Mailer: Elm [revision: 70.30]

Hi everybody!

I'm a postgres user on a ultrix 4.3 machine. Postgres so far is 
running, but i've got some problems when i try to define an ADT
with internallength=variable.
I know i don't need  variablelength in the example below but that's just a
short version of my problem, which nevertheless should work, shouldn't it?

What am i doing wrong? I would be very glad if someone helps me

Thanks Wolf

****************************************************************************
****************************************************************************
****************************************************************************

 SOURCE CODE OF STR.C 
 both routines doing nothing else than returning NULL 
 compiled with following options:  cc -G0 -O0 -c str.c

****************************************************************************
****************************************************************************
****************************************************************************
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include "postgres.h"
#include "palloc.h"
#include "builtins.h"

struct varlena *xpr_str_in ();
char         *xpr_str_out ();


struct varlena *xpr_str_in (str)
  char *str;
{

  return (NULL);
} /* xpr_string_in */


char *xpr_str_out (arg)
  struct varlena *arg; /* postgresinterne Darstellung eines Strings */
{

  return (NULL);


} /* xpr_string_out */




****************************************************************************
****************************************************************************
****************************************************************************

 This is what i do at the monitor in a brandnew database

****************************************************************************
****************************************************************************
****************************************************************************

define function xpr_str_in (language = "c",
                               returntype = XPR_STR,
                               trusted = f
                              )
                              arg is (char16)
                              as "/user/sonst/wfguddat/XPR2PG/str.o"\g
define function xpr_str_out (language = "c",
                                returntype = char16,
                                trusted = f
                               )
                               arg is (XPR_STR)
                               as "/user/sonst/wfguddat/XPR2PG/str.o"\g
define type XPR_STR (internallength = variable,
                        externallength = variable,
                        input = xpr_str_in,
                        output = xpr_str_out
                       )\g

create S (s= XPR_STR)\g

/**** so far all seems OK 
/**** i've omitted the answers from the backend 
/**** but now i can't do an append

* append S (s = "Test")\g


Query sent to backend is "append S (s = "Test")"
NOTICE:May 13 15:20:04:ufp_start: forked UFP[17543]
NOTICE:May 13 15:20:07:ufp_recv: read failed on length: No such file or directory
NOTICE:May 13 15:20:07:ufp_recvval: read failed on byvalue
NOTICE:May 13 15:20:07:ufp_kill: UFP cleaned up!
WARN:May 13 15:20:07:ufp_execute: error reading return value

Go
*



/*****
/*****The following doesn't work too 
/***** 

* append S (s = "Test"::XPR_STR)\g

Query sent to backend is "append S (s = "Test"::XPR_STR)"
NOTICE:May 13 15:22:20:ufp_start: forked UFP[17558]
NOTICE:May 13 15:22:21:ufp_recv: read failed on length: No such process
NOTICE:May 13 15:22:21:ufp_recvval: read failed on byvalue
NOTICE:May 13 15:22:21:ufp_kill: UFP cleaned up!
WARN:May 13 15:22:21:ufp_execute: error reading return value


*
