Return-Path: owner-postman
Received: from localhost (localhost [127.0.0.1]) by nobozo.CS.Berkeley.EDU (8.6.3/8.6.3) with SMTP id OAA29356 for postgres-dist; Thu, 4 Nov 1993 14:57:48 -0800
Resent-From: POSTGRES mailing list <postman@postgres.Berkeley.EDU>
Resent-Message-Id: <199311042257.OAA29356@nobozo.CS.Berkeley.EDU>
X-Authentication-Warning: nobozo.CS.Berkeley.EDU: Host localhost didn't use HELO protocol
Sender: owner-postman@postgres.Berkeley.EDU
X-Return-Path: owner-postman
Received: from pepper.Stanford.EDU (pepper.Stanford.EDU [36.22.0.141]) by nobozo.CS.Berkeley.EDU (8.6.3/8.6.3) with SMTP id OAA29347 for <postgres@nobozo.cs.berkeley.edu>; Thu, 4 Nov 1993 14:57:47 -0800
Received: by pepper.Stanford.EDU (5.57/Ultrix3.0-C)
	id AA11630; Thu, 4 Nov 93 14:57:46 -0800
Date: Thu, 4 Nov 93 14:57:46 -0800
From: verghese@pepper.Stanford.EDU (Ben Verghese)
Message-Id: <9311042257.AA11630@pepper.Stanford.EDU>
To: postgres@postgres.Berkeley.EDU
Subject: postquel functions
Resent-To: postgres-dist@postgres.Berkeley.EDU
Resent-Date: Thu, 04 Nov 93 14:57:48 -0800
Resent-XMts: smtp


I am trying to call a user defined postquel function from libpq and having
some problems. The function is defined as


define function acctupdt
(language = "postquel", returntype = setof int4)
arg is (int4, int4, int4, int4)
as " replace ACCT(bal = ACCT.bal + $4) where ACCT.aid = $3
replace TELLER(bal = TELLER.bal + $4) where TELLER.tid = $2
replace BRANCH(bal = BRANCH.bal + $4) where BRANCH.bid = $1
retrieve(x = 1)"

I can call it from the monitor and it works fine. However if I try to call it
from libpq from within a C program it gets the following intermittent errors
(I have attached a code fragment from the C program showing the call). Anyone
know why this is happening ?


	Returned balance is 0, in time (29,90605) for 1
	WARN:Nov  4 14:49:09:init_fcache: Cache lookup failed for procedure 0
	e 0

	Returned balance is 0, in time (1,-79913) for 2
	Returned balance is 0, in time (1,-260001) for 3
	Returned balance is 0, in time (1,289999) for 4
	WARN:Nov  4 14:49:12:init_fcache: Cache lookup failed for procedure 0
	e 0

	Returned balance is 0, in time (1,-450001) for 5
	Returned balance is 0, in time (1,-310001) for 6
	Returned balance is 0, in time (0,739999) for 10


(Note: The returned balance 0 is okay, I am concerned about the Warning)




code fragment (in a loop):

  c = buf1;
  c += sprintf(c, "retrieve (x = acctupdt(%d,%d,%d,%d))",
	       bid, tid, aid, delta);
  PQexec(buf1);




thanks,

	Ben Verghese

********************************************************************************
Ben Verghese				Ph: 	(415) 723-4388 (office)
Computer Systems Lab				(415) 725-3732 (lab)
Electrical Engineering Dept.		Email:	verghese@pepper.stanford.edu
Stanford University
********************************************************************************
