PLpgSQL Stat Problem

Started by Andy Lewisover 26 years ago3 messages
#1Andy Lewis
alewis@themecca.net

I posted the following message in [GENERAL] and still haven't been able to
resolve the problem.

The file permissions are set to postgres and postgres is authorized to
access /usr/local/pgsql/lib.

What I am trying to do is insert a row into a DB but, I want to be able to
check each row for a specified column prior to insert to see if there is a
duplicate column.
If there is I want to be able to abort or simply skip that insert. If
there are any easier ways to do this please let me know.

I'm running Postgres 6.4.2 on Linux.

Any ideas would be greatly appreciated.

Please email any resonses to the above email address as I don't belong to
[HACKERS].

Thanks in advance.

Andy

Show quoted text

I got the following error after trying to copy the example at:
http://www.postgresql.org/mhonarc/pgsql-sql/1999-04/msg00076.html

----------------------------------------------------------
test=> select a(pin,first_name) from ibs_subscriber ;
ERROR: stat failed on file ${exec_prefix}/lib/plpgsql.so
----------------------------------------------------------

The file plpgsql.so does exist in /usr/local/pgsql/lib.
Any ideas?

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andy Lewis (#1)
Re: [HACKERS] PLpgSQL Stat Problem

Andy Lewis <alewis@themecca.net> writes:

I got the following error after trying to copy the example at:
http://www.postgresql.org/mhonarc/pgsql-sql/1999-04/msg00076.html

test=> select a(pin,first_name) from ibs_subscriber ;
ERROR: stat failed on file ${exec_prefix}/lib/plpgsql.so

Looks like the system is trying to use the literal filename
"${exec_prefix}/lib/plpgsql.so", which of course is not right.

I'm guessing that when you copied the CREATE FUNCTION out of the
example, you just cut and pasted without doing the shell variable
expansion that was supposed to happen to replace ${exec_prefix}
with /usr/local/pgsql ...

regards, tom lane

#3Andy Lewis
alewis@themecca.net
In reply to: Tom Lane (#2)
Re: [HACKERS] PLpgSQL Stat Problem

Solved! Thanks.

I know this is dumb but, I ran mklang.sql on a test DB and in that file it
references: ${exec_prefix}

Without thinking to remove the DB and start from scratch.

Anyway thanks to all.

Andy

On Thu, 29 Apr 1999, Tom Lane wrote:

Show quoted text

Andy Lewis <alewis@themecca.net> writes:

I got the following error after trying to copy the example at:
http://www.postgresql.org/mhonarc/pgsql-sql/1999-04/msg00076.html

test=> select a(pin,first_name) from ibs_subscriber ;
ERROR: stat failed on file ${exec_prefix}/lib/plpgsql.so

Looks like the system is trying to use the literal filename
"${exec_prefix}/lib/plpgsql.so", which of course is not right.

I'm guessing that when you copied the CREATE FUNCTION out of the
example, you just cut and pasted without doing the shell variable
expansion that was supposed to happen to replace ${exec_prefix}
with /usr/local/pgsql ...

regards, tom lane