Can't add PL/PGSQL function even after running createlang.

Started by Michael R. Faheyover 24 years ago3 messagesgeneral
Jump to latest
#1Michael R. Fahey
mfahey@qilinlaw.com

I'm trying to add the add_one example from the documentation
(Programming 24.4, ex. 24-2). When I try to create the function, psql
complains that the language is unrecognized. I have already run
createlang plpgsql template1 from the command line and then added a test
database. I want to add the function to the test database. Also,
createlang -l test and createlang -l template1 show no functional
languages installed. Any ideas?

I'm running 7.1.3.

Thanks.

Michael

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Michael R. Fahey (#1)
Re: Can't add PL/PGSQL function even after running createlang.

"Michael R. Fahey" <mfahey@qilinlaw.com> writes:

... I have already run
createlang plpgsql template1 from the command line

It sure sounds like that step failed. Did you pay attention to any
messages it generated?

regards, tom lane

#3Michael R. Fahey
mfahey@qilinlaw.com
In reply to: Tom Lane (#2)
Re: Can't add PL/PGSQL function even after running createlang.

[...]

"Michael R. Fahey" <mfahey@qilinlaw.com> writes:

... I have already run
createlang plpgsql template1 from the command line

It sure sounds like that step failed. Did you pay attention to any
messages it generated?

I tried the commands again dumped the messages into a new file plpgsql.

$ createlang -l template1

Procedural languages
Name | Trusted? | Compiler
------+----------+----------
(0 rows)

createlang: missing required argument PGLIB directory
(This is the directory where the interpreter for the procedural
language is stored. Traditionally, these are installed in whatever
'lib' directory was specified at configure time.)

$export PGLIB=/usr/local/pgsql/lib >> pl*
echo $PGLIB >> pl*
/usr/local/pgsql/lib

$ls /usr/local/pgsql/lib >> pl*

libecpg.a
libecpg.so
libecpg.so.3
libecpg.so.3.2.0
libpgeasy.a
libpgeasy.so
libpgeasy.so.2
libpgeasy.so.2.1
libpq.a
libpq.so
libpq.so.2
libpq.so.2.1
plpgsql.so

$createlang plpgsql template1 >> pl*
createlang: A function named 'plpgsql_call_handler' already exists.
Installation aborted.

$droplang -d template1 plpgsql >> pl*
droplang: 'plpgsql' is not installed in database template1

$createlang plpgsql template1 >> pl*
createlang: A function named 'plpgsql_call_handler' already exists.
Installation aborted.

createlang -l template1 >> pl*
Procedural languages
Name | Trusted? | Compiler
------+----------+----------
(0 rows)

Michael Fahey