Return-Path: owner-postman
Received: from localhost (localhost [127.0.0.1]) by nobozo.CS.Berkeley.EDU (8.6.4/8.6.3) with SMTP id MAA25141 for postgres-redist; Mon, 27 Jun 1994 12:10:08 -0700
Resent-From: POSTGRES mailing list <postman@postgres.Berkeley.EDU>
Resent-Message-Id: <199406271910.MAA25141@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 cs.mtu.edu (cs.mtu.edu [141.219.150.12]) by nobozo.CS.Berkeley.EDU (8.6.4/8.6.3) with SMTP id MAA25131 for <postgres@postgres.Berkeley.EDU>; Mon, 27 Jun 1994 12:10:05 -0700
Received: from werner.mtu.edu (werner.cs.mtu.edu) by cs.mtu.edu (4.1/SMI-4.1)
	id AA19441; Mon, 27 Jun 94 15:10:06 EDT
From: aataneja@cs.mtu.edu (Bruce Taneja.)
Message-Id: <9406271910.AA19441@cs.mtu.edu>
Subject: Re: " GetAttributeByName " ..
To: postgres@postgres.Berkeley.EDU
Date: Mon, 27 Jun 1994 15:10:05 -0400 (EDT)
In-Reply-To: <199406270618.XAA29544@faerie.CS.Berkeley.EDU> from "Paul M. Aoki" at Jun 26, 94 11:18:45 pm
X-Mailer: ELM [version 2.4 PL22]
Content-Type: text
Content-Length: 1031      
Resent-To: postgres-redist@postgres.Berkeley.EDU
Resent-Date: Mon, 27 Jun 94 12:10:07 -0700
Resent-XMts: smtp

> 
> bool
> test(t, s)
>     TUPLE t;
>     char *s;
> {
>     bool isnull = 0;
>     CIRCLE *c = (CIRCLE *) GetAttributeByName(t, "a", &isnull);
> 
>     if (isnull)
> 	return(0);
> 
>     elog(NOTICE, "test: circle = (%f,%f,%f), string = %.16s",
> 	 c->center.x, c->center.y, c->radius, s);
> 
>     return(1);
> }


Hi Paul, 
Thanks for your help!

  After playing around with your exmaple above, I think I found
what was wrong, but I can't really explain it:

The above example runs perfectly even on ver 4.1 (  :)  ) , but 
as soon as I changed the line : 

>     CIRCLE *c = (CIRCLE *) GetAttributeByName(t, "a", &isnull);
  
to the following:

>     CIRCLE *c = (CIRCLE *) GetAttributeByName(t, "a");

  i.e removed the "&isnull)" and etc. in the test()  , the computer 
hanged !

Now why does the GetAttributeByName() work OK w/o the 3rd param.
when running the overpaid(EMP) example in the 8.4.3 section (user manual)
and simply hangs when used w/o the 3rd param in the circle example .. !?

thanks for your help!
Bruce.


==============================================================================
   To add/remove yourself to/from the POSTGRES mailing list: send mail with 
   the subject line ADD or DEL to "postgres-request@postgres.Berkeley.EDU"

   If this fails, send mail to "post_questions@postgres.Berkeley.EDU" and
   a human will deal with it.  DO NOT post to the "postgres" mailing list.
==============================================================================
