Loading shared object files into Postgres
Hello,
I have issued the "make" command for the $PGROOT/src/tutorial/Makefile
file and then issued
load '/home/postgres/linux/src/tutorial/complex.so'
from interactive psql to load the object file into the address space and
received the following:
"PQexec() -- Request was sent to backend, but backend closed the channel
before responding.
This probably means the backend terminated abnormally before or
while processing the request."
What does that mean? What is wrong?
Kostas Vassiliadis
Konstantinos Vassiliadis wrote:
Do I have to be the Postgres "superuser" in order to be able to load a
shared object file (just like you need to have "superuser" priviledges in
order to register C functions with Postgres)?
It sure is the same thing (from the manpage on load):
-----------------
If a file is not loaded using the load command, the file will be loaded
automatically the first time the function is called by Postgres. Load
can also be used to reload an object file if it has been edited and
recompiled. Only objects created from C language files are supported at
this time.
-----------------
Your guess on Postgres superuser privileges may be right. It always
worked fine for me, but I never used postgres as anyone other than
postgres (for updates) and nobody (for selects). You can use createuser
to give yourself superuser privileges in postgres (see INTERACTIVE
QUESTIONS) in "man createuser".
Other than that, did you modify the source in tutorial? Did you check
the backend logfile? The error message you reported is too generic. By
the way, if you will ever want to debug your extension, there is
virtually no other way than using fprintf(stderr, ...) or opening a file
and writing into it from inside the code.
--Gene
Import Notes
Reference msg id not found: Pine.LNX.3.95.980717163054.5984B-100000@p22.cs.man.ac.uk | Resolved by subject fallback