#NEWLINE# def last_insert_id( self , cursor , table_name , pk_name ) : #NEWLINE# #INDENT# cursor . execute ( ( "SELECT CURRVAL(pg_get_serial_sequence('%s','%s'))" % ( self . quote_name ( table_name ) , pk_name ) ) ) #NEWLINE# return cursor . fetchone ( ) [ 0 ]