Code

Opened 7 years ago

Closed 7 years ago

#5055 closed (fixed)

Postgres version mismatch

Reported by: donarb@… Owned by: adrian
Component: Database layer (models, ORM) Version: master
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The get_sql_flush() method in django/db/backends/postgresql/base.py uses "ALTER SEQUENCE". This method was added for the test system's fixture loading.

The get_sql_sequence_reset() method in core/management.py uses the older "SELECT setval()" method, available in PostgreSQL 7.3. "ALTER SEQUENCE" was added in PostgreSQL 7.4.

This patch changes both postgresql/base.py and postgresql_psycopg2/base.py to use the setval() method for resetting the sequence.

Attachments (1)

postgresql.diff (3.4 KB) - added by Don Arbow <donarb@…> 7 years ago.

Download all attachments as: .zip

Change History (3)

Changed 7 years ago by Don Arbow <donarb@…>

comment:1 Changed 7 years ago by Simon G. <dev@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Ready for checkin

comment:2 Changed 7 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

(In [6009]) Fixed #5055 -- Changed Postgres DatabaseOperations.sql_flush() to use 'SELECT setval()' instead of 'ALTER SEQUENCE', because the latter only works with Postgres 7.3+. Thanks, Don Arbow

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.