Return-Path: pg_adm@postgres.berkeley.edu
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA25201; Mon, 27 Apr 92 13:56:00 -0700
Date: Mon, 27 Apr 92 13:56:00 -0700
From: "Raymond Frost (305) 284-3969" <RFROST@umiami.IR.Miami.EDU>
Subject: System call in C function
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu
To: postgres@postgres.berkeley.edu
Message-Id: <01GJCKWYHH4G9AMMC1@umiami.IR.Miami.EDU>
X-Envelope-To: postgres@postgres.berkeley.edu
X-Vms-To: IN%"postgres@postgres.berkeley.edu"


I am trying to execute a system call from withing a C
function.  I wrote the following C function:

#include <stdio.h>
char warning()
{
        system("echo hi > /tmp/dog\n");
        return(1>0);
}

The function seems to define and load without any problem.  It also
appears to have gotten as far as the return line since all tuples
are returned.  Yet the file "dog" is never created.

Query sent to backend is "define function warning (   language = "c",                              returntype = bool)       arg is (RELATION)      as "/u/rfrost/postgres/demo/m.o" "
DEFINE
Query sent to backend is "load "/u/rfrost/postgres/demo/m.o" "
LOAD
Query sent to backend is "retrieve (emp.all) where warning(emp)  "
-----------------------------------------------------------------------
| salary      | manager     | location    | age         | name        |
-----------------------------------------------------------------------
| 1000        | sam         | (15,12)     | 25          | sharon      |
-----------------------------------------------------------------------
| 6000        | bill        | (10,5)      | 30          | sam         |
-----------------------------------------------------------------------
| 3000        | sharon      | (11,10)     | 20          | bill        |
-----------------------------------------------------------------------


Thanks in advance,

Raymond Frost
University of Miami

