niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Databases » PostgreSQL
Problem creating a function
Post new topic   Reply to topic Page 1 of 1 [8 Posts] View previous topic :: View next topic
Author Message
Cornelia Boenigk
*nix forums beginner


Joined: 19 Jul 2006
Posts: 4

PostPosted: Wed Jul 19, 2006 9:30 pm    Post subject: Re: Problem creating a function - solved Reply with quote

Hi Tom, Joe

After compiling the C-source files

# gcc -fpic -c bitvg.c
# gcc -shared -o bitvg.so bitvg.o

the pg_restore created the function.
It is Suse 9.x and PG 8.1.4

Thanks
Conni




---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster
Back to top
Tom Lane
*nix forums Guru


Joined: 24 Mar 2005
Posts: 2070

PostPosted: Wed Jul 19, 2006 9:14 pm    Post subject: Re: Problem creating a function Reply with quote

Joe Conway <mail@joeconway.com> writes:
Quote:
Could it be an SELinux issue?

I'd really expect the strerror result to be something about 'permission
denied' rather than 'file not found', if that were the problem...

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org
Back to top
Joe Conway
*nix forums beginner


Joined: 10 Mar 2005
Posts: 32

PostPosted: Wed Jul 19, 2006 8:22 pm    Post subject: Re: Problem creating a function Reply with quote

Cornelia Boenigk wrote:
Quote:
Hi Joe

Try:
su postgres
cd /home/database/pgdata/cobis/bitvg

Succeeds, ls -la shows all files in that directory and can open them
with less.

Kind of odd, particularly given your reply to Tom's question in a nearby
post. Could it be an SELinux issue?

Joe

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly
Back to top
Cornelia Boenigk
*nix forums beginner


Joined: 19 Jul 2006
Posts: 4

PostPosted: Wed Jul 19, 2006 7:16 pm    Post subject: Re: Problem creating a function Reply with quote

Hi Tom

Quote:
You should try "ldd" or local equivalent on bitvg.so to check
whether all its dependencies can be found.

output:
ldd /home/database/pgdata/cobis/bitvg/bitvg.so
statically linked

Regards
Conni

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match
Back to top
Tom Lane
*nix forums Guru


Joined: 24 Mar 2005
Posts: 2070

PostPosted: Wed Jul 19, 2006 5:40 pm    Post subject: Re: Problem creating a function Reply with quote

Cornelia Boenigk <c@cornelia-boenigk.de> writes:
Quote:
in english: /home/database/pgdata/cobis/bitvg/bitvg.so: cannot open
shared object: file not found

The file does exist in the path /home/database/pgdata/cobis/bitvg/:

The "file not found" might be coming from the dynamic loader trying to
load some other library that bitvg.so depends upon. You should try "ldd"
or local equivalent on bitvg.so to check whether all its dependencies
can be found. Also, try looking in the postmaster log --- on some
platforms, dynamic loader failures spit additional information to stderr
that can't be reported to you by the backend, but will be captured in
the postmaster log file.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster
Back to top
Cornelia Boenigk
*nix forums beginner


Joined: 19 Jul 2006
Posts: 4

PostPosted: Wed Jul 19, 2006 5:34 pm    Post subject: Re: Problem creating a function Reply with quote

Hi Joe

Quote:
Try:
su postgres
cd /home/database/pgdata/cobis/bitvg

Succeeds, ls -la shows all files in that directory and can open them
with less.

Regards
Conni


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org
Back to top
Joe Conway
*nix forums beginner


Joined: 10 Mar 2005
Posts: 32

PostPosted: Wed Jul 19, 2006 5:08 pm    Post subject: Re: Problem creating a function Reply with quote

Cornelia Boenigk wrote:
Quote:
The file does exist in the path /home/database/pgdata/cobis/bitvg/:
-rwxr-xr-x 1 root root 133 Jul 19 13:13 bitvg.c
-rwxr-xr-x 1 root root 782 Jul 19 13:13 bitvg.o
-rwxr-xr-x 1 root root 3198 Jul 19 13:13 bitvg.so

What do I miss?

Does the postgres user have access to /home/database/pgdata/cobis/bitvg?

Try:
su postgres
cd /home/database/pgdata/cobis/bitvg

Joe

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match
Back to top
Cornelia Boenigk
*nix forums beginner


Joined: 19 Jul 2006
Posts: 4

PostPosted: Wed Jul 19, 2006 4:31 pm    Post subject: Problem creating a function Reply with quote

Hi all

Trying to create a function I get the following:

codex=# CREATE FUNCTION "bitvg" (integer,integer) RETURNS integer AS
'/home/database/pgdata/cobis/bitvg/bitvg.so', 'bitvg' LANGUAGE 'C';
ERROR: could not load library
"/home/database/pgdata/cobis/bitvg/bitvg.so":
/home/database/pgdata/cobis/bitvg/bitvg.so: Kann die
Shared-Object-Datei nicht öffnen: Datei oder Verzeichnis nicht gefunden

in english: /home/database/pgdata/cobis/bitvg/bitvg.so: cannot open
shared object: file not found

The file does exist in the path /home/database/pgdata/cobis/bitvg/:
-rwxr-xr-x 1 root root 133 Jul 19 13:13 bitvg.c
-rwxr-xr-x 1 root root 782 Jul 19 13:13 bitvg.o
-rwxr-xr-x 1 root root 3198 Jul 19 13:13 bitvg.so

What do I miss?

Thank's in advance
Conni
--
http://pgsql.info | http://postgresql.de | http://pgfakt.de
Telefon: 07127 80 961

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [8 Posts] View previous topic :: View next topic
The time now is Thu Dec 04, 2008 2:19 am | All times are GMT
navigation Forum index » Databases » PostgreSQL
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Unknown in header problem -SOLVED- Light Speed Postfix 0 Thu Jul 03, 2008 10:40 am
No new posts problem with sending mail nuxia Postfix 0 Mon Apr 21, 2008 3:58 am
No new posts Postfix 2.3.8 Virtual problem Blotto Postfix 0 Fri Apr 04, 2008 6:11 am
No new posts Postfix sending problem for local domain remote email monkey_magix Postfix 0 Mon Sep 10, 2007 10:17 am
No new posts bounce problem murkis Postfix 0 Sun Oct 08, 2006 3:45 pm

Apply for Credit Card | Web Advertising | Credit Card | Secured Loans | Internet Businesses Online Articles
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.4857s ][ Queries: 20 (0.3922s) ][ GZIP on - Debug on ]