pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Carlos Peralta Ramirez <cperalta@hera.inf.ucv.cl>
To: pgsql-novice <pgsql-novice@hub.org>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
To: pgsql-sql <pgsql-sql@postgresql.org>
To: pgsql-general <pgsql-general@postgresql.org>
Subject: which guru know this ??
Date: Wed, 05 May 1999 03:44:01 -0500
Message-ID: <373004CF.C7286A32@hera.inf.ucv.cl> (raw)



Primary, Sorry for my english !!!


Hi,

I ´m developing a several test database, for study. But I can´t create
any function, every time ERROR appears.
I write a C code in a plus2.c file

#include <pgsql/postgres.h>

int4 plus2(int4 a,int4 b)
{
return(a+b);
}

main() /* For getting *.out*/
{
}

, then I compile it (I made this of two ways)

cc -c plus2.c       /* I get the object file *.o */

or

cc plus2.c plus2.out  /*I get the *.out file */

When I create the function on postgresql, occurs this

db=> create function plus2(int4,int4) returns int4 as
'/var/lib/pgsql/plus2.o' language 'c';
CREATE

or

db=> create function plus2(int4,int4) returns int4 as
'/var/lib/pgsql/plus2.out' language 'c';
CREATE

Wherever, when I call the function plus2 from Sql sentence ...

db=> select plus2(6,6);
ERROR:  Load of file /var/lib/pgsql/plus2.o failed:
(ô@(ô@/pgsql/plus2.o: ELF file's phentsize not the expected size

or, with plus2.out

db=> select plus2(6,6);
PQexec() -- Request was sent to backend, but backend closed the channel
before responding.
This probably means the backend terminated abnormally before or while
processing the request.

If anybody can help me, thank !!!

PD: I don´t disturb you, if I don´t need it really.






view thread (2+ messages)  latest in thread

Message-ID: <373004CF.C7286A32@hera.inf.ucv.cl>
Permalink:  ../373004CF.C7286A32@hera.inf.ucv.cl/
Also on:    postgresql.org/message-id/373004CF.C7286A32@hera.inf.ucv.cl

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: cperalta@hera.inf.ucv.cl, pgsql-novice@hub.org, pgsql-hackers@postgresql.org, pgsql-general@postgresql.org
  Subject: Re: which guru know this ??
  In-Reply-To: <373004CF.C7286A32@hera.inf.ucv.cl>
  References: <373004CF.C7286A32@hera.inf.ucv.cl>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox