psycopg2 open file for reading

Поиск
Список
Период
Сортировка
От Dan Sawyer
Тема psycopg2 open file for reading
Дата
Msg-id 5630DA60.5060004@earthlink.net
обсуждение исходный текст
Ответы Re: psycopg2 open file for reading
Список psycopg
The question relates to copy file commands within a python script. The
database open and file operations are working correctly.

The string passed to psycopg2 is:    copy_string = 'copy temp_tbl from
'/tmp/test.txt' csv delimiter '|';'

The psycopg2 commands executed tried are:

cursoro.copy_expert(copy_string,f)
and
cursoro.execute(copy_string)

Both produce the follow errors:

Traceback (most recent call last):
   File "./norm_name_py_01.py", line 162, in <module>
     main()
   File "./norm_name_py_01.py", line 157, in main
     cursoro.copy_expert(copy_string,f)
psycopg2.ProgrammingError: could not open file "/tmp/test.txt" for
reading: Permission denied

ls -altr /tmp/test.txt
-rw-rw-r--. 1 dan dan 52833 Oct 28 06:07 /tmp/test.txt

Dan


В списке psycopg по дате отправления:

Предыдущее
От: Daniel Son
Дата:
Сообщение: Getting the query id
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: psycopg2 open file for reading