Your message dated 
with message-id <[email protected]>
and subject line python-pgsql removed from Debian unstable
has caused the Debian Bug report #266315,
regarding Wrong exception for referential integrity violation
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
266315: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=266315
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: python2.3-pgsql
Version: 2.4.0-5

Installed version of postgresql is 7.4.3-3


pyPgSQL is raising OperationalError rather than IntegrityError for
referential integrity violations.

The pyPgSQL / PosgtreSQL combination in woody (python2.1-pgsql 2.0-3.2
/ postgresql 7.2.1-2woody5) raised IntegrityError as expected.


dbapi 2.0 says:

  IntegrityError             

      Exception raised when the relational integrity of the
      database is affected, e.g. a foreign key check fails.  It
      must be a subclass of DatabaseError.

  OperationalError

      Exception raised for errors that are related to the
      database's operation and not necessarily under the control
      of the programmer, e.g. an unexpected disconnect occurs,
      the data source name is not found, a transaction could not
      be processed, a memory allocation error occurred during
      processing, etc.  It must be a subclass of DatabaseError.


Test script:

DBNAME = "test"
DBUSER = "test"

from pyPgSQL import PgSQL
dbapi = PgSQL

conn = dbapi.connect(database=DBNAME, user=DBUSER)
curs = conn.cursor()

curs.execute("""
CREATE TABLE main (
    id INTEGER,
    PRIMARY KEY (id)
);

CREATE TABLE sub (
    id INTEGER REFERENCES main,
    name VARCHAR(32)
);
""")

curs.execute("INSERT INTO main VALUES (%s)", (1,))

try:
    curs.execute("INSERT INTO sub VALUES (%s, %s)", (2, "test"))
except dbapi.IntegrityError:
    pass
except Exception, e:
    print "Raised wrong exception:\n%r\n%s" % (e, e)
else:
    print "Failed to raise exception"

curs.close()


--- End Message ---
--- Begin Message ---
Version: 2.5.1-2+rm

python-pgsql has been removed from Debian unstable: 
http://bugs.debian.org/620494

Closing its bugs with a Version higher than the last unstable upload.

More information about this script at:
  
http://git.debian.org/?p=users/morph/mass-bugs-close.git;a=blob_plain;f=README;hb=HEAD


--- End Message ---

Reply via email to