Documentation Source Text
Check-in [72af2c4df1]
Not logged in

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

Overview
SHA1 Hash:72af2c4df12c9ac1997439a761dd72b75577064a
Date: 2013-03-19 20:00:00
User: drh
Comment:Improved documentation for PRAGMA foreign_key_check and foreign_key_list.
Tags And Properties
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to pages/pragma.in

965
966
967
968
969
970
971
972
973

974
975
976
977

978
979

980
981
982
983
984
985
986
987
988



989
990
991
992
993
994
995
    ^(The third column is the name of the database file itself, or an empty
    string if the database is not associated with a file.)^</p>
}

Pragma foreign_key_list {
    <p>^(<b>PRAGMA foreign_key_list(</b><i>table-name</i><b>);</b></p>

    <p>This pragma returns one row for each foreign key that references
    a column in the argument table.)^

}

Pragma foreign_key_check {
    <p><b>^(PRAGMA foreign_key_check;)^</b></p>


    <p>The foreign_key_check pragma checks the database for 

    [foreign key constraints] that are violated and returns one row of
    output for each violation.  There are four columns in each result row.
    The first column is the name of the table that contains the REFERENCES
    clause.  The second column is the [rowid] of the row that
    contains the invalid REFERENCES clause.  The third column is the name
    of the table that is referred to. The fourth column is the index of
    the specific foreign key constraint that failed.  The fourth column
    in the output of the foreign_key_check pragma is the same integer as
    the first column in the output of the [foreign_key_list pragma].</p>



}

Pragma freelist_count {
    <p>^(<b>PRAGMA freelist_count;</b></p>
    <p>Return the number of unused pages in the database file.)^</p>
}








|
|
>



|
>

|
>








|
>
>
>







965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
    ^(The third column is the name of the database file itself, or an empty
    string if the database is not associated with a file.)^</p>
}

Pragma foreign_key_list {
    <p>^(<b>PRAGMA foreign_key_list(</b><i>table-name</i><b>);</b></p>

    <p>This pragma returns one row for each [foreign key constraint]
    created by a REFERENCES clause in the CREATE TABLE statement of
    table "<i>table-name</i>".)^
}

Pragma foreign_key_check {
    <p>^(<b>PRAGMA foreign_key_check;
        <br>PRAGMA foreign_key_check(</b><i>table-name</i><b>);</b>)^</b></p>

    <p>The foreign_key_check pragma checks the database, or the table
    called "<i>table-name</i>", for 
    [foreign key constraints] that are violated and returns one row of
    output for each violation.  There are four columns in each result row.
    The first column is the name of the table that contains the REFERENCES
    clause.  The second column is the [rowid] of the row that
    contains the invalid REFERENCES clause.  The third column is the name
    of the table that is referred to. The fourth column is the index of
    the specific foreign key constraint that failed.  The fourth column
    in the output of the foreign_key_check pragma is the same integer as
    the first column in the output of the [foreign_key_list pragma].
    When a "<i>table-name</i>" is specified, the only foreign key constraints
    checked are those created by REFERENCES clauses in the
    CREATE TABLE statement for <i>table-name</i>.</p>
}

Pragma freelist_count {
    <p>^(<b>PRAGMA freelist_count;</b></p>
    <p>Return the number of unused pages in the database file.)^</p>
}