Documentation Source Text

Check-in [2d50d47170]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix a typo on lang_createtable.html.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 2d50d47170a7dccbb7d1cfba16cfea4afa654bd5
User & Date: dan 2010-09-30 18:23:36
Context
2010-10-01
19:03
Clarify that if a CHECK expression evaluates to NULL, it is not a constraint violation. check-in: 217545f050 user: dan tags: trunk
2010-09-30
18:23
Fix a typo on lang_createtable.html. check-in: 2d50d47170 user: dan tags: trunk
16:31
Add missing image: numeric-literal.gif. check-in: d1c65c4e95 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to pages/lang.in.

   768    768   
   769    769   <p>If a table has a single column primary key, and the declared type of that
   770    770     column is "INTEGER", then the column is known as an [INTEGER PRIMARY KEY].
   771    771     See below for a description of the special properties and behaviours
   772    772     associated with an [INTEGER PRIMARY KEY].
   773    773   
   774    774   <p>^Each row in a table with a primary key must feature a unique combination
   775         -  of values in its primary key columns. ^For the purposes of the previous
   776         -  statement, NULL values are considered distinct from all other values,
   777         -  including other NULLs. ^If an [INSERT] or [UPDATE] statement attempts to
   778         -  modify the table content so that two or more rows feature identical primary
   779         -  key values, it is a constraint violation. According to the SQL standard,
   780         -  PRIMARY KEY should always imply NOT NULL. Unfortunately, due to a
   781         -  long-standing coding oversight, this is not the case in SQLite. ^Unless the
   782         -  column is an [INTEGER PRIMARY KEY] SQLite allows NULL values in a PRIMARY KEY
   783         -  column.  We could change SQLite to conform to the standard (and we might do
   784         -  so in the future), but by the time the oversight was discovered, SQLite was
   785         -  in such wide use that we feared breaking legacy code if we fixed the problem.
   786         -  So for now we have chosen to continue allowing NULLs in PRIMARY KEY columns.
   787         -  Developers should be aware, however, that we may change SQLite to conform to
   788         -  the SQL standard in future and should design new programs accordingly.
          775  +  of values in its primary key columns. ^For the purposes of determining
          776  +  the uniqueness of primary key values, NULL values are considered distinct from
          777  +  all other values, including other NULLs. ^If an [INSERT] or [UPDATE]
          778  +  statement attempts to modify the table content so that two or more rows
          779  +  feature identical primary key values, it is a constraint violation.
          780  +  According to the SQL standard, PRIMARY KEY should always imply NOT NULL.
          781  +  Unfortunately, due to a long-standing coding oversight, this is not the
          782  +  case in SQLite. ^Unless the column is an [INTEGER PRIMARY KEY] SQLite
          783  +  allows NULL values in a PRIMARY KEY column.  We could change SQLite to
          784  +  conform to the standard (and we might do so in the future), but by the time
          785  +  the oversight was discovered, SQLite was in such wide use that we feared
          786  +  breaking legacy code if we fixed the problem.  So for now we have chosen to
          787  +  continue allowing NULLs in PRIMARY KEY columns.  Developers should be
          788  +  aware, however, that we may change SQLite to conform to the SQL standard in
          789  +  future and should design new programs accordingly.
   789    790   
   790    791   <p>^A <b>UNIQUE</b> constraint is similar to a PRIMARY KEY constraint, except
   791    792     that a single table may have any number of UNIQUE constraints. ^For each
   792    793     UNIQUE constraint on the table, each row must feature a unique combination
   793    794     of values in the columns identified by the UNIQUE constraint. ^As with
   794    795     PRIMARY KEY constraints, for the purposes of UNIQUE constraints NULL values
   795    796     are considered distinct from all other values (including other NULLs).