Explorar o código

member ip inserts DO NOTHING on conflict

Grant Limberg %!s(int64=5) %!d(string=hai) anos
pai
achega
e1bc9771b2
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      controller/PostgreSQL.cpp

+ 1 - 1
controller/PostgreSQL.cpp

@@ -989,7 +989,7 @@ void PostgreSQL::commitThread()
 						};
 
 						res = PQexecParams(conn,
-							"INSERT INTO ztc_member_ip_assignment (member_id, network_id, address) VALUES ($1, $2, $3)",
+							"INSERT INTO ztc_member_ip_assignment (member_id, network_id, address) VALUES ($1, $2, $3) ON CONFLICT (network_id, member_id, address) DO NOTHING",
 							3,
 							NULL,
 							v3,