| 
      
      
      From: Jorge G. <go...@ie...> - 2003-08-27 18:55:59
      
     | 
| Hi.
I have to feed a database with several hundred entries and I am
importing all those with PostgreSQL's 'COPY <table> FROM <file>'
command. It works great when I'm using my superuser but it fails for
any other user with a message specifying that I should either:
    * use my superuser
    * make these users superuser
    * or use 'stdin' (this is the recommendation on the error message)
      as source for my input.
Since I can't make other superusers (there are several other databases
there that should be protected from common employees) I was trying to
use stdin as data source.
Anybody has tried it? I don't know how to concatenate the thousands of
lines from the output of a 'file.readlines()' (or something like that)
to my cursor.execute() command. Using something like
"cursor.execute(query_sql, file.readlines())" didn't work and gave me
an error message saying 'not all arguments converted' (query_sql is
the copy from command). 
TIA,
-- 
Godoy.     <go...@ie...>
 |