This project is archived and is in readonly mode.

#150 ✓resolved
Catalin Iacob

Test failures about NOTICE messages on unreleased Postgres 9.3

Reported by Catalin Iacob | March 14th, 2013 @ 09:24 PM

Some tests related to NOTICE messages fail with Posgres 9.3 (compiled from Git a few days ago).

The failures happen because statements like: create temp table chatty (id serial primary key); are expected to return NOTICEs that an implicit index and sequence were created for id and in 9.3 those messages have DEBUG1 level, see;a=commit;h=d7c73...

Attached patch against devel branch fixes the tests, I tested it with 7.4, 9.2 and Git 9.3.

Comments and changes to this ticket

  • Daniele Varrazzo

    Daniele Varrazzo March 15th, 2013 @ 11:37 AM

    Thank you, I'll look into the issue.

    Out of curiosity, wouldn't have been the same to add on top of the failing tests something like:

    if postgres_version >= 9.3:
        set client_min_message = debug1

    and keep the tests unchanged?

  • Catalin Iacob

    Catalin Iacob March 15th, 2013 @ 04:42 PM

    They couldn't stay completely unchanged. With debug1 I get an extra message (building index...) so at least the test that counts the notices would need changes:

    psycopg2_test=# set client_min_messages = debug1;
    psycopg2_test=# create temp table abc2 (id serial primary key);
    DEBUG:  CREATE TABLE will create implicit sequence "abc2_id_seq" for serial column ""
    DEBUG:  CREATE TABLE / PRIMARY KEY will create implicit index "abc2_pkey" for table "abc2"
    DEBUG:  building index "abc2_pkey" on table "abc2"
  • Daniele Varrazzo

    Daniele Varrazzo March 15th, 2013 @ 04:48 PM

    • State changed from “new” to “open”

    I see, thank you for the tests. I'll commit your test suite patch for the next release.

  • Catalin Iacob

    Catalin Iacob March 15th, 2013 @ 05:06 PM

    Actually, I checked instead of just reasoning about it and I was wrong, the alternative also works.

    The notices get counted only for tables that don't have primary keys so there is no "building index..." message that gets in the way.

    So the attached alternative patch also passes all tests.

  • Catalin Iacob

    Catalin Iacob March 15th, 2013 @ 05:13 PM

    Correct patch now. I attached the wrong file in previous message (and deleted it now to avoid confusion).

  • Daniele Varrazzo
  • Daniele Varrazzo

    Daniele Varrazzo March 16th, 2013 @ 12:56 AM

    • State changed from “open” to “resolved”

    Pushed to devel, thank you.

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

<b>WARNING:</b> the informations in this tracker are archived. Please submit new tickets or comments to <a href="">the new tracker</a>.
Psycopg is the most used PostgreSQL adapter for the Python programming language. At the core it fully implements the Python DB API 2.0 specifications. Several extensions allow access to many of the features offered by PostgreSQL.

Shared Ticket Bins