saving files in a database

Поиск
Список
Период
Сортировка
Искать

saving files in a database

От:
Chris <tomcat@weirdness.com>
Дата:
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.

FAQ