My understanding is, if you have system calls from within
postgres, the child processes invoked are run in the
postgres user's environment.
So, login as user postgres and have a look what aliases
are set. My idea is, because postgres is not a human user,
these aliases are not set. I think, if
I'm working on a HP-UX system, so some of the
following has to be adapted, but in principle
it's the same on every system and it works.
First piece of code is a standalone program,
which you should always write and test before
you start creating C functions inside PostgreSQL.
Second piece is
quot;%s\" >/tmp/mailtmp.txt
\n",VARDATA(message));
system(string_tosend);
sprintf(string_tosend,"mail -s \"message from PostgreSQL\" %s
To: "Miguel González" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, September 19, 2001 12:24
Did you use the compiler option for generating
position independent code (PIC) for use in building
shared libraries.
Did you use the linker option for creating
a shared library - I think you did, the file
suffix .so looks that way.
I did it several times successfully using commands
like
CREA
Miguel González writes:
> ERROR:/load of file /home/postgres/ctof.so failed: /home/postgres/ctof.so
> ELF file´s phentsize not the expected size.
You probably didn't compile or link the code correctly. See the
PostgreSQL Programmer's Guide for information.
--
Peter Eisentraut [EMAIL PROTEC
I have followed
the instructions in the Bruje Momjian´s book to register afunction, and i
got this message: ERROR:/load of file /home/postgres/ctof.so
failed: /home/postgres/ctof.soELF file´s phentsize not the expected
size.What is going on? I have tried to get more documentation about how