| От | Ottavio Campana |
|---|---|
| Тема | is it possibile get the psql prompt output? |
| Дата | |
| Msg-id | 4FB35210.9000009@campana.vi.it обсуждение исходный текст |
| Ответы |
Re: is it possibile get the psql prompt output?
Re: is it possibile get the psql prompt output? |
| Список | psycopg |
I am writing a small python script and I'd like to get the output I
would get as if I executed the commands from psql. Let's make an
example, suppose you have a small table such as
create table xxx_test (
id serial,
description text);
and that you perform this command in psql
mydb=# INSERT INTO xxx_test values (default, 'ciao');
INSERT 0 1
mydb=#
In python I do
cursor = connection.cursor ()
cursor.execute (command)
connection.commit ()
with command being the insert command. Now the question is: is there a
way to get the "INSERT 01" back?
Thank you,
Ottavio
В списке psycopg по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера