From 5d9034bc92e9def0785a3b7cd9ca65e284db0191 Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Tue, 1 Aug 2017 22:53:17 +0200 Subject: [PATCH] Removed unused DatabaseOperations.last_insert_id() on PostgreSQL. Unused since 9eb2afddfa0165d69f3e506122c2aa2b68618591. --- django/db/backends/postgresql/operations.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/django/db/backends/postgresql/operations.py b/django/db/backends/postgresql/operations.py index 2cc886a76d..bff8e87d68 100644 --- a/django/db/backends/postgresql/operations.py +++ b/django/db/backends/postgresql/operations.py @@ -85,13 +85,6 @@ class DatabaseOperations(BaseDatabaseOperations): return lookup - def last_insert_id(self, cursor, table_name, pk_name): - # Use pg_get_serial_sequence to get the underlying sequence name - # from the table name and column name (available since PostgreSQL 8) - cursor.execute("SELECT CURRVAL(pg_get_serial_sequence('%s','%s'))" % ( - self.quote_name(table_name), pk_name)) - return cursor.fetchone()[0] - def no_limit_value(self): return None