Thread: ERROR stat failed on file

ERROR stat failed on file

From
Konstantinos Vassiliadis
Date:
Hi,
I created a datatype dealing with phone numbers just to test the
particular Postgres facility.
I compiled the source independently of Postgres and run it independently,
too.

Then, I registered the input and output functions with Postgres and
created the type using CREATE FUNCTION and CREATE TYPE respectively.
However, when it came to insert values into the table columns the
following came up:

 ERROR:  stat failed on file /home/M97/acs/vassilik/protein/phone.o

Note that this is the path that I have included in the CREATE FUNCTION
statements for registering the input and output functions.

Thinking that I did something wrong, I tried the Complex datatype and
still gave me the following when inserting data:

 ERROR:  stat failed on file /home/M97/acs/vassilik/protein/complex.o

What is the problem?

Kostas Vassiliadis


Re: [GENERAL] ERROR stat failed on file

From
"Gene Selkov, Jr."
Date:
Konstantinos Vassiliadis wrote:
>
> Hi,
> I created a datatype dealing with phone numbers just to test the
> particular Postgres facility.
> I compiled the source independently of Postgres and run it independently,
> too.
>
> Then, I registered the input and output functions with Postgres and
> created the type using CREATE FUNCTION and CREATE TYPE respectively.

I assume you realize that nothing happens when you register a function
with CREATE FUNCTION. It simply sets the path to your object.

> However, when it came to insert values into the table columns the
> following came up:
>
>  ERROR:  stat failed on file /home/M97/acs/vassilik/protein/phone.o
>

At this point, it attempts to actually use the object. You will get this
error in two situations:

   1. When the path is incorrect, i. e., there is no such file

   2. The file exists but it does not contain a shared object

Based on your description, I think you are dealing with the cause (2).
Look into

   ..../pgsql/src/tutorial/Makefile

for ideas how to build a shared object on your system.


--Gene