Skip site navigation (1) Skip section navigation (2)

Re: is it possibile get the psql prompt output?

From: Egbert Bouwman <egbert(dot)bouwman(at)xs4all(dot)nl>
To: psycopg(at)postgresql(dot)org
Subject: Re: is it possibile get the psql prompt output?
Date: 2012-05-16 08:17:49
Message-ID: 20120516101749.271a3d87@para.lan (view raw or flat)
Thread:
Lists: psycopg
On Wed, 16 May 2012 09:06:56 +0200
Ottavio Campana <ottavio(at)campana(dot)vi(dot)it> wrote:

> 
> 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?
> 

Is this what you are looking for :
cursor.execute(command)
cursor.statusmessage


e

-- 
Egbert Bouwman

In response to

psycopg by date

Next:From: Kryklia AlexDate: 2012-05-16 09:22:25
Subject: Question aboud #80 - itersize in cursor dic
Previous:From: Federico Di GregorioDate: 2012-05-16 07:24:18
Subject: Re: is it possibile get the psql prompt output?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group