Received: from sttlpop5.sttl.uswest.net (sttlpop5.sttl.uswest.net [206.81.192.5]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id eA5KYSs56942 for ; Sun, 5 Nov 2000 15:34:29 -0500 (EST) (envelope-from jaalaw1@uswest.net) Received: (qmail 9616 invoked by alias); 5 Nov 2000 20:34:16 -0000 Received: (qmail 9606 invoked by uid 0); 5 Nov 2000 20:34:15 -0000 Received: from ssdslppp180.sttl.uswest.net (HELO uswest.net) (216.160.111.180) by sttlpop5.sttl.uswest.net with SMTP; 5 Nov 2000 20:34:15 -0000 Message-ID: <3A05C528.F1B05899@uswest.net> Date: Sun, 05 Nov 2000 12:38:00 -0800 From: jaalaw1 X-Mailer: Mozilla 4.75 [en] (X11; U; Linux 2.2.14-5.0 i586) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-interfaces@postgresql.org Subject: lo_import: cannot lo_import linux files Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200011/68 X-Sequence-Number: 104 I am new to postgres and trying to use pqlib lo_import(PGconn *conn, const char * filename) to bulk insert directories of data files into a sql table with the original pathname as the text field and the oid of the inversion filea as the oid field. I want to serve the files to users from the sql tables. I use version 7.0.2-2 from the redhat rpmms on rh6.2 linux 2.2.14-5 The table I used for testing my code is: create table images(name text, doc oid); I used the testlo.c examples as my guide. All of the database connectiion and file handling work as epected. I used 'find' to generate the fully qualified path names and redirected it to the file dirlst; My code opens dirlst, fgets(namebuf, 127, dirlst) each pathname into namebuf, strips the newline, assigns the new pathname to fname, all works ok. To actually insert the name 'fname' and oid into the sql table 'images' my code uses: res = PQexec(conn, "INSERT INTO images (name, doc) VALUES (fname, lo_import(conn, fname))") PQtrace says Error: Attribute 'fname' not found or cannot open unix file fname or 'cannot open unix file permisision denied; Permissions are particularly troublesome since I want to load entier trees into the table and many trees are owned by various users with various permissions set. I would like some pointers on where to look in addition to the htm files in the distribution. I am new to postgres but have used linux as my desktop for several years. any advice appreciated. rod Jones