From: Billy G. A. <bal...@us...> - 2001-10-17 06:38:24
|
Update of /cvsroot/pypgsql/pypgsql/pyPgSQL In directory usw-pr-cvs1:/tmp/cvs-serv8437/pyPgSQL Modified Files: PgSQL.py Log Message: 17OCT2001 bga Fixed some problems with the large object handling. --- Added the lo_export method, which was missing. Index: PgSQL.py =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/pyPgSQL/PgSQL.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PgSQL.py 2001/10/13 20:58:22 1.1 --- PgSQL.py 2001/10/17 06:38:21 1.2 *************** *** 30,33 **** --- 30,36 ---- # Date Ini Description | # --------- --- ------------------------------------------------------- | + # 17OCT2001 bga Added code to ensure that creation of a binary object | + # via the binary() method always occurs within the con- | + # text of a transaction. | # 27SEP2001 bga Change code so that the escaping/quoting is different | # if the result is to be used to build PostgreSQL arrays. | *************** *** 1666,1669 **** --- 1669,1676 ---- _nl = len(self.conn.notices) + # Ensure that we are in a transaction for working with large objects + if not self.inTransaction: + conn.conn.query("BEGIN WORK") + _lo = self.conn.lo_creat(INV_READ | INV_WRITE) *************** *** 1677,1681 **** --- 1684,1693 ---- if len(self.conn.notices) != _nl: + if not self.inTransaction: + conn.conn.query("ROLLBACK WORK") raise Warning, self.conn.notices.pop() + + if not self.inTransaction: + conn.conn.query("COMMIT WORK") return _lo |