Can't add PL/PGSQL function even after running createlang.
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
"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
[...]
"Michael R. Fahey" <mfahey@qilinlaw.com> writes:
... I have already run
createlang plpgsql template1 from the command lineIt 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
Import Notes
Resolved by subject fallback