pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Chris <tomcat@weirdness.com>
To: pgsql-php@postgresql.org
Subject: saving files in a database
Date: Mon, 11 Sep 2000 16:43:50 +1000
Message-ID: <4.3.2.7.2.20000911163621.00aa3b10@mail.pharm.usyd.edu.au> (raw)

Hi everyone,
I'm trying to write a script that will let a user save a file into a 
database. This is my SQL..

$sql="insert into scripts (id, submittedby, description, script, 
scriptfile) values (nextval('scripts_id_seq'), '$loginname', 
'$description', '$script', lo_import('$userfile'))";

This is the error I receive when I try and run the sql -

Warning: PostgresSQL query failed: ERROR: You must have Postgres superuser 
privilege to use server-side lo_import(). Anyone can use the client-side 
lo_import() provided by libpq. in put-file.php on line 4

OK, I understand the error message, but I don't want to use libpq, I don't 
want to learn C at the moment. How do I fix it? Change my sql or php? 
Update my permissions table? This is it at the moment..

users=# \z
Access permissions for database "xxxx"
      Relation     | Access permissions
------------------+---------------------
  scripts          | {"=","wwwrun=arwR"}
  scripts_id_seq   | {"=","wwwrun=arwR"}

wwwrun is what apache is running as.. Any suggestions would be great.

Thanks
Chris.




Message-ID: <4.3.2.7.2.20000911163621.00aa3b10@mail.pharm.usyd.edu.au>
Permalink:  ../4.3.2.7.2.20000911163621.00aa3b10@mail.pharm.usyd.edu.au/
Also on:    postgresql.org/message-id/4.3.2.7.2.20000911163621.00aa3b10@mail.pharm.usyd.edu.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: tomcat@weirdness.com
  Subject: Re: saving files in a database
  In-Reply-To: <4.3.2.7.2.20000911163621.00aa3b10@mail.pharm.usyd.edu.au>
  References: <4.3.2.7.2.20000911163621.00aa3b10@mail.pharm.usyd.edu.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox