Return-Path: pg_adm@postgres.berkeley.edu
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA17051; Fri, 11 Dec 92 20:52:04 -0800
Date: Fri, 11 Dec 92 20:52:04 -0800
Message-Id: <9212120452.AA17051@postgres.Berkeley.EDU>
From: jdc@sunset.cse.nau.edu (John Campbell)
Subject: Re: Backend crashes--is it me or a bug?
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu
Cc: bug-postgres@postgres.berkeley.edu

Shoot...  In preparing my previous article I included the wrong script!

I'm refering to the following:

On Dec 11 at  4:08pm, John Campbell writes:
 >Message-Id: <9212120008.AA15889@postgres.Berkeley.EDU>
 >Subject: Backend crashes--is it me or a bug?
 >To: postgres@postgres.Berkeley.EDU
 >
 >Platform:  SS2 running SunOS 4.1.2
 >Postgres: 4.0.1
 >
 >I'm wondering if I've run across a bug in postgres 4.0.1.
  . . .
 >The symptom is that a query hangs and sometimes the backend
 >crashes when I do
 >
 >   retrieve (COMPUTER.ip) \g

And then I included the script I had been experimenting with (it
has a critical query commented out).

If you have any patience left, please try this script instead:
----cut here for computer.pq----
/* Learn by playing with a small test set. */

destroy VENDOR \p\g
destroy COMPUTER \p\g
remove function vendor \p \g
remove function ip_text \p \g
remove function ip \p \g

create VENDOR (name = text, phone=text) \p\g
create COMPUTER (name = text, model=text, _ven=text) \p\g

define function ip_text
 (language = "c", returntype = text)
 arg is (text)
 as "/home/sunset/jdc/.postgres/ip.o" \g

/* Remember that postgres has to have read privilege.*/
load "/home/sunset/jdc/.postgres/ip.o" \g

define function vendor
 (language = "postquel", returntype = VENDOR)
 arg is (COMPUTER)
 as "retrieve (VENDOR.all) where VENDOR.name = $1._ven" \p\g

/* populate with 2 VENDORs and 3 COMPUTERs */
append VENDOR (name = "SUN", phone="1234") \p\g
append VENDOR (name = "DEC", phone="5678") \p\g

append COMPUTER (name = "sunset.cse.nau.edu", model="SS2", _ven="SUN") \p\g
append COMPUTER (name = "slate.cse.nau.edu", model="SS2", _ven="SUN") \p\g
append COMPUTER (name = "naucse.cse.nau.edu", model="MVII", _ven="DEC") \p\g

/* Now define a different function. */
define function ip
   (language="postquel", returntype = text)
   arg is (COMPUTER)
   as "retrieve ($1.name.ip_text)" \p\g

retrieve (COMPUTER.ip, COMPUTER.name) where COMPUTER.name = "naucse.cse.nau.edu" \p\g

retrieve (COMPUTER.name, COMPUTER.ip) where 1=1 \p\g

/* Now we hang, I believe because of the previous query */
retrieve (COMPUTER.name, COMPUTER.ip) \p\g
----end of computer.pq----

-- 
	John Campbell               John.Campbell@nau.edu
        jdc@sunset.cse.nau.edu      JDC@NAUVAX.UCC.NAU.EDU
