Thay track all of us and "optimalise" search results. My list of links could differ from yours.
I have googled key phrase '"UNIQUE constraint failed:" sqlite primary key' and similar, but not read whole received documents, perform only brief look on it. This is best practice by my experience, english is not my first language and reading whole long documents is painfullness for me. Apology to boring experts with dumb question. L. > Hi Petr, > if you Google for "database table primary key" the first few results lead to > quite good explanations. > Also, the english wikipedia's article "Unique key" explains primary keys. > HTH > Martin > Am 14.09.2015 22:25 schrieb Petr L?z?ovsk? <lazna at volny.cz>: >> I had googled to verify such idea before, but have no luck. >> Thanks, L. >> > Hello Petr, >> > defining the column pid as INTEGER PRIMARY KEY you added an implicit >> > contraint; a primary key means that only one record with a given value >> > of pid can exist in the table. >> > See https://www.sqlite.org/lang_createtable.html#rowid >> > Martin >> > Am 14.09.2015 um 21:04 schrieb Petr L?z?ovsk?: >> >> Have following table: >> >> CREATE TABLE ip_addr >> >> ( >> >> /*! Person identificator (PID) %%a */ pid INTEGER PRIMARY KEY NOT NULL, >> >> /*! IP address %%b */ ip_addr VARCHAR (16) NOT NULL, >> >> /*! Status: 0 - Allowed, Unassigned to specific customer (blocked) */ >> >> /*! Status: 1 - Allowed, Asigned to concrete customer */ >> >> /*! Status: 2 - Disallowed, Assigned to blocked user */ >> >> /*! Status: 3 - Disallowed, Assigned to history user */ >> >> /*! Status of IP address %%c */ ip_status INTEGER NOT NULL, >> >> /*! Type: 1 - Private */ >> >> /*! Type: 2 - Public */ >> >> /*! Type: 3 - IPv6 */ >> >> /*! Type of IP address %%d */ ip_type INTEGER NOT NULL, >> >> /*! Date of blocking %%e */ blocked_at INTEGER, >> >> /*! Blocking note %%f */ blocking_note VARCHAR >> >> ); >> >> ) >> >> If inserting row containing PID already exist in table, sqlite generate >> >> %subj% error. But there is not such constraint in database definition. >> >> Did I miss something? >> >> L. >> >> _______________________________________________ >> >> sqlite-users mailing list >> >> sqlite-users at mailinglists.sqlite.org >> >> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users >> > _______________________________________________ >> > sqlite-users mailing list >> > sqlite-users at mailinglists.sqlite.org >> > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users >> _______________________________________________ >> sqlite-users mailing list >> sqlite-users at mailinglists.sqlite.org >> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users