23505

ماذا يعني خطأ Postgres (قاعدة البيانات) هذا

كيف يظهر

duplicate key value violates unique constraint "<constraint_name>"

ماذا يعني

SQLSTATE 23505 is unique_violation: the row would repeat a value in a column, or set of columns, that must be unique, such as a primary key or an email column.

السبب المعتاد في تطبيق مبني بالذكاء الاصطناعي

A common case is AI-written sign-up code that inserts a profile row for the new user while a database trigger has already created one, or code that runs insert on every sign-in instead of upsert.

افحص هذا أولًا

Note the constraint name in the error, then search the table for a row that already holds the value you tried to insert.

رموز أخرى من Postgres (قاعدة البيانات)