agora inbox for postgres@postgres.berkeley.edu
help / color / mirror / Atom feedFrom: Paul M. Aoki <aoki@CS.Berkeley.EDU>
To: Bruce Taneja. <aataneja@cs.mtu.edu>
Cc: postgres@postgres.Berkeley.EDU
Subject: Re: " GetAttributeByName " ..
Date: Sun, 26 Jun 94 23:18:45 -0700
Message-ID: <199406270618.XAA29544@faerie.CS.Berkeley.EDU> (raw)
In-Reply-To: <9406262150.AA16321@cs.mtu.edu>
aataneja@cs.mtu.edu (Bruce Taneja.) writes:
> /* bca = (CIRCLE *) GetAttributeByName(t, "a"); */
GetAttributeByName has three arguments, one of which is a bool.
> .. has any body else had any good luck with GetAttributeByName(),
> can any body see why the monitor program hangs for me .. ?
this is postgres 4.2 on ultrix. sorry, haven't the time to load 4.1
on a sparc, or to fix a bug in 4.1 if your problem is a bug. here goes..
Script started on Sun Jun 26 23:15:17 1994
faerie:aoki (1)> createdb bruce
faerie:aoki (2)> monitor bruce < bruce.pq
Welcome to the POSTGRES terminal monitor
Go
*
Query sent to backend is "define function circle_in ( language = "c", returntype = circle ) arg is (any) as "/faerie/aoki/postgres/src/regress/regress/obj/regress.o" "
NOTICE:Jun 27 06:15:46:ProcedureDefine: type 'circle' is not yet defined
NOTICE:Jun 27 06:15:46:ProcedureDefine: creating a shell for type 'circle'
DEFINE
Go
*
Query sent to backend is "define function circle_out ( language = "c", returntype = any ) arg is (any) as "/faerie/aoki/postgres/src/regress/regress/obj/regress.o" "
DEFINE
Go
*
Query sent to backend is "define type circle ( internallength = 24, input = circle_in, output = circle_out ) "
DEFINE
Go
*
Query sent to backend is "load "/faerie/aoki/postgres/src/regress/regress/obj/regress.o" "
LOAD
Go
*
Query sent to backend is "create tutorial (a = circle) "
CREATE
Go
*
Query sent to backend is "append tutorial (a = "(15,12,1)"::circle) "
APPEND 21386
Go
*
Query sent to backend is "define function test (language = "c", returntype = bool) arg is (tutorial, char16) as "/faerie/aoki/postgres/src/regress/regress/obj/bruce.o" "
DEFINE
Go
*
Query sent to backend is "retrieve (x = test(t, "1"::char16)) from t in tutorial "
NOTICE:Jun 27 06:15:50:test: circle = (15.000000,12.000000,1.000000), string = 1
---------------
| x |
---------------
| t |
---------------
Go
* faerie:aoki (3)> cat bruce.c
#include "tmp/postgres.h"
#include "tmp/libpq-fe.h"
#include "utils/geo-decls.h"
#include "utils/log.h" /* for elog status codes */
typedef struct {
POINT center;
double radius;
} CIRCLE;
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);
}
faerie:aoki (4)> exit
script done on Sun Jun 26 23:16:01 1994
--
Paul M. Aoki | CS Div., Dept. of EECS, UCB | aoki@CS.Berkeley.EDU
| Berkeley, CA 94720-1776 | ...!uunet!ucbvax!aoki
==============================================================================
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.
==============================================================================
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: postgres@postgres.berkeley.edu
Cc: aoki@CS.Berkeley.EDU, aataneja@cs.mtu.edu
Subject: Re: " GetAttributeByName " ..
In-Reply-To: <199406270618.XAA29544@faerie.CS.Berkeley.EDU>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox