Return-Path: pg_adm@postgres.berkeley.edu
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA13335; Wed, 10 Jun 92 10:13:53 -0700
Date: Wed, 10 Jun 92 10:13:53 -0700
Message-Id: <9206101713.AA13335@postgres.Berkeley.EDU>
From: mstacy@mayo.EDU (Mahlon Stacy  4-4558)
Subject: Operation fails when both sides are Record elements
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu

I have defined a C function to check equality of two varlena
elements:

/* sequal.c  Compares two strings and returns Boolean true if equal */
/* MCS 6/10/92 */

#include <stdio.h>
#include "tmp/postgres.h"

bool sequal(s1,s2)
struct varlena *s1, *s2;
{
        int i;
        char *a, *b;


        a = VARDATA(s1);
        b = VARDATA(s2);

        i = strcmp(a,b);

        if(i==0) return(true);
        return(false);
}

This compiles, has been defined, along with the "=" token. 

The following works:

* retrieve (FILE.name, FILE.directory) where FILE.name = "heartbeatmov"
\g

Query sent to backend is "retrieve (FILE.name, FILE.directory) where FILE.name = "heartbeatmov" "
-----------------------------
| name        | directory   |
-----------------------------
| heartbeatmov| /images/8/SUN_DEMO|
-----------------------------
| heartbeatmov| /images/8/SUN_DEMO|
-----------------------------
| heartbeatmov| /images/8/SUN_DEMO|
-----------------------------
| heartbeatmov| /images/rolls/demoan/dsr|
-----------------------------
| heartbeatmov| /images/rolls/demoan/dsr|
-----------------------------
| heartbeatmov| /images/rolls/demoan/dsr|
-----------------------------

The following fails with the indicated error:

* retrieve (F1.name, F2.name) from F1 in FILE, F2 in FILE where F1.name = F2.name \g

Query sent to backend is "retrieve (F1.name, F2.name) from F1 in FILE, F2 in FILE where F1.name = F2.name "
WARN:Jun 10 11:13:07:fmgr: Cache lookup failed for procedure 0


What's the difference?

	-Mahlon
-------------------------------------------------------------
Mahlon Stacy                   Internet:   mcs@mayo.edu
Mayo Foundation                Amateur:    KF0AW
Rochester, MN 55905            Medical Science Bldg 1-29
(507) 284-4558                 FAX (507) 284-1428
-------------------------------------------------------------
