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.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 2d50d47170a7dccbb7d1cfba16cfea4afa654bd5
User & Date: dan 2010-09-30 18:23:36.000
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
Unified Diff Ignore Whitespace Patch
Changes to pages/lang.in.
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782

783
784
785
786
787
788
789
790
791
792
793
794
795

<p>If a table has a single column primary key, and the declared type of that
  column is "INTEGER", then the column is known as an [INTEGER PRIMARY KEY].
  See below for a description of the special properties and behaviours
  associated with an [INTEGER PRIMARY KEY].

<p>^Each row in a table with a primary key must feature a unique combination
  of values in its primary key columns. ^For the purposes of the previous
  statement, NULL values are considered distinct from all other values,
  including other NULLs. ^If an [INSERT] or [UPDATE] statement attempts to
  modify the table content so that two or more rows feature identical primary
  key values, it is a constraint violation. According to the SQL standard,
  PRIMARY KEY should always imply NOT NULL. Unfortunately, due to a
  long-standing coding oversight, this is not the case in SQLite. ^Unless the
  column is an [INTEGER PRIMARY KEY] SQLite allows NULL values in a PRIMARY KEY

  column.  We could change SQLite to conform to the standard (and we might do
  so in the future), but by the time the oversight was discovered, SQLite was
  in such wide use that we feared breaking legacy code if we fixed the problem.
  So for now we have chosen to continue allowing NULLs in PRIMARY KEY columns.
  Developers should be aware, however, that we may change SQLite to conform to
  the SQL standard in future and should design new programs accordingly.

<p>^A <b>UNIQUE</b> constraint is similar to a PRIMARY KEY constraint, except
  that a single table may have any number of UNIQUE constraints. ^For each
  UNIQUE constraint on the table, each row must feature a unique combination
  of values in the columns identified by the UNIQUE constraint. ^As with
  PRIMARY KEY constraints, for the purposes of UNIQUE constraints NULL values
  are considered distinct from all other values (including other NULLs).







|
|
|
|
|
|
|
|
>
|
|
|
|
|
|







768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796

<p>If a table has a single column primary key, and the declared type of that
  column is "INTEGER", then the column is known as an [INTEGER PRIMARY KEY].
  See below for a description of the special properties and behaviours
  associated with an [INTEGER PRIMARY KEY].

<p>^Each row in a table with a primary key must feature a unique combination
  of values in its primary key columns. ^For the purposes of determining
  the uniqueness of primary key values, NULL values are considered distinct from
  all other values, including other NULLs. ^If an [INSERT] or [UPDATE]
  statement attempts to modify the table content so that two or more rows
  feature identical primary key values, it is a constraint violation.
  According to the SQL standard, PRIMARY KEY should always imply NOT NULL.
  Unfortunately, due to a long-standing coding oversight, this is not the
  case in SQLite. ^Unless the column is an [INTEGER PRIMARY KEY] SQLite
  allows NULL values in a PRIMARY KEY column.  We could change SQLite to
  conform to the standard (and we might do so in the future), but by the time
  the oversight was discovered, SQLite was in such wide use that we feared
  breaking legacy code if we fixed the problem.  So for now we have chosen to
  continue allowing NULLs in PRIMARY KEY columns.  Developers should be
  aware, however, that we may change SQLite to conform to the SQL standard in
  future and should design new programs accordingly.

<p>^A <b>UNIQUE</b> constraint is similar to a PRIMARY KEY constraint, except
  that a single table may have any number of UNIQUE constraints. ^For each
  UNIQUE constraint on the table, each row must feature a unique combination
  of values in the columns identified by the UNIQUE constraint. ^As with
  PRIMARY KEY constraints, for the purposes of UNIQUE constraints NULL values
  are considered distinct from all other values (including other NULLs).