X-Original-To: pgsql-admin@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 2281D474E4F for ; Wed, 26 Feb 2003 06:30:45 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 48285-05 for ; Wed, 26 Feb 2003 06:30:34 -0500 (EST) Received: from news.hub.org (news.hub.org [64.49.215.80]) by postgresql.org (Postfix) with ESMTP id 753AA474E42 for ; Wed, 26 Feb 2003 06:30:34 -0500 (EST) Received: by news.hub.org (Postfix, from userid 8) id 58AAA43A611; Wed, 26 Feb 2003 06:30:34 -0500 (EST) From: "Gaetano Mendola" X-Newsgroups: comp.databases.postgresql.admin Subject: ExclusiveLock and Python Date: Wed, 26 Feb 2003 12:30:38 +0100 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 63 Message-ID: Reply-To: "Gaetano Mendola" X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 To: pgsql-admin@postgresql.org X-Virus-Scanned: by amavisd-new X-Archive-Number: 200302/400 X-Sequence-Number: 7598 Hi all, doing the following query select * from pg_locks where mode = 'ExclusiveLock'; I obtain: relation | database | transaction | pid | mode | granted ----------+----------+-------------+-------+---------------+--------- | | 2560899 | 20404 | ExclusiveLock | t ExclusiveLock on what ? BTW I obtain this ExclusiveLock just doing a connection with a Python program using the pgdb interface: db_connection = pgdb.connect( ) and I obtain: $> ps -eafwww | grep post postgres 10408 21357 0 12:02 ? 00:00:00 postgres: kalman kalman [local] idle in transaction I seen inside the pgdb.py code and I found that in the constructor of pgdbCnx is performed: src.execute("BEGIN") and the methods commit and rollback: def commit(self): try: src = self.__cnx.source() src.execute("COMMIT") src.execute("BEGIN") except: raise OperationalError, "can't commit." def rollback(self): try: src = self.__cnx.source() src.execute("ROLLBACK") src.execute("BEGIN") except: raise OperationalError, "can't rollback." so it seem that is no an "autocommit" behaviour, How can avoid to open a transaction if is not needed ? Exist a way to emulate an autocommit behaviour or should I modify the pgdb.py ? Regards Gaetano