Why would PRAGMA schema.index_list(table-name); not show primary keys?2019 Community Moderator ElectionSqlite primary key on multiple columnsSQLite add Primary KeySQLite Reset Primary Key FieldIs an index needed for a primary key in SQLite?How to read this qtstring in qsqlquery.execSQLite Multi-column Insert/Replace with Multiple Joindoes ALTER TABLE conflict with IF TABLE NOT EXISTCross-querying multiple tables in an SQLite database without indexed foreign keysSQLSTATE[HY000]: General error: 1 near “action”: syntax errorUnable to read a value which exists

How do electrons receive energy when a body is heated?

How exactly does an Ethernet collision happen in the cable, since nodes use different circuits for Tx and Rx?

Does "Until when" sound natural for native speakers?

School performs periodic password audits. Is my password compromised?

What do *foreign films* mean for an American?

When a wind turbine does not produce enough electricity how does the power company compensate for the loss?

In the late 1940’s to early 1950’s what technology was available that could melt ice?

How does Ehrenfest's theorem apply to the quantum harmonic oscillator?

Source permutation

Why does cron require MTA for logging?

Can one live in the U.S. and not use a credit card?

Would an aboleth's Phantasmal Force lair action be affected by Counterspell, Dispel Magic, and/or Slow?

Possible to detect presence of nuclear bomb?

Windows Server Data Center Edition - Unlimited Virtual Machines

Do cubics always have one real root?

Are all players supposed to be able to see each others' character sheets?

Can the alpha, lambda values of a glmnet object output determine whether ridge or Lasso?

Does a difference of tense count as a difference of meaning in a minimal pair?

Proving a statement about real numbers

Is a piano played in the same way as a harmonium?

Which situations would cause a company to ground or recall a aircraft series?

Is it a Cyclops number? "Nobody" knows!

For which categories of spectra is there an explicit description of the fibrant objects via lifting properties?

Power Strip for Europe



Why would PRAGMA schema.index_list(table-name); not show primary keys?



2019 Community Moderator ElectionSqlite primary key on multiple columnsSQLite add Primary KeySQLite Reset Primary Key FieldIs an index needed for a primary key in SQLite?How to read this qtstring in qsqlquery.execSQLite Multi-column Insert/Replace with Multiple Joindoes ALTER TABLE conflict with IF TABLE NOT EXISTCross-querying multiple tables in an SQLite database without indexed foreign keysSQLSTATE[HY000]: General error: 1 near “action”: syntax errorUnable to read a value which exists










0















According to the documentation, PRAGMA schema.index_list(table-name); should list all of the indexes including primary keys.



However, when I use it I only get the secondary indexes.



https://www.sqlite.org/pragma.html#pragma_index_info



What would cause the primary keys to not be listed?



CREATE TABLE Employee
(
EmployeeKey INTEGER PRIMARY KEY,
FirstName nvarChar(25) NOT NULL,
MiddleName nvarChar(25) NULL,
LastName nVarChar(25) NOT NULL,
Title nVarChar(100) null,
EmployeeId nvarChar(50) NOT NULL,
ManagerKey INT NULL REferences Employee(EmployeeKey),
OfficePhone VARCHAR(15) NULL ,
CellPhone VARCHAR(15) NULL ,
CreatedDate DateTime NOT NULL DEFAULT CURRENT_TIME,
UpdatedDate DateTime NULL
)

CREATE UNIQUE INDEX index_name ON Employee(EmployeeId);









share|improve this question


























    0















    According to the documentation, PRAGMA schema.index_list(table-name); should list all of the indexes including primary keys.



    However, when I use it I only get the secondary indexes.



    https://www.sqlite.org/pragma.html#pragma_index_info



    What would cause the primary keys to not be listed?



    CREATE TABLE Employee
    (
    EmployeeKey INTEGER PRIMARY KEY,
    FirstName nvarChar(25) NOT NULL,
    MiddleName nvarChar(25) NULL,
    LastName nVarChar(25) NOT NULL,
    Title nVarChar(100) null,
    EmployeeId nvarChar(50) NOT NULL,
    ManagerKey INT NULL REferences Employee(EmployeeKey),
    OfficePhone VARCHAR(15) NULL ,
    CellPhone VARCHAR(15) NULL ,
    CreatedDate DateTime NOT NULL DEFAULT CURRENT_TIME,
    UpdatedDate DateTime NULL
    )

    CREATE UNIQUE INDEX index_name ON Employee(EmployeeId);









    share|improve this question
























      0












      0








      0








      According to the documentation, PRAGMA schema.index_list(table-name); should list all of the indexes including primary keys.



      However, when I use it I only get the secondary indexes.



      https://www.sqlite.org/pragma.html#pragma_index_info



      What would cause the primary keys to not be listed?



      CREATE TABLE Employee
      (
      EmployeeKey INTEGER PRIMARY KEY,
      FirstName nvarChar(25) NOT NULL,
      MiddleName nvarChar(25) NULL,
      LastName nVarChar(25) NOT NULL,
      Title nVarChar(100) null,
      EmployeeId nvarChar(50) NOT NULL,
      ManagerKey INT NULL REferences Employee(EmployeeKey),
      OfficePhone VARCHAR(15) NULL ,
      CellPhone VARCHAR(15) NULL ,
      CreatedDate DateTime NOT NULL DEFAULT CURRENT_TIME,
      UpdatedDate DateTime NULL
      )

      CREATE UNIQUE INDEX index_name ON Employee(EmployeeId);









      share|improve this question














      According to the documentation, PRAGMA schema.index_list(table-name); should list all of the indexes including primary keys.



      However, when I use it I only get the secondary indexes.



      https://www.sqlite.org/pragma.html#pragma_index_info



      What would cause the primary keys to not be listed?



      CREATE TABLE Employee
      (
      EmployeeKey INTEGER PRIMARY KEY,
      FirstName nvarChar(25) NOT NULL,
      MiddleName nvarChar(25) NULL,
      LastName nVarChar(25) NOT NULL,
      Title nVarChar(100) null,
      EmployeeId nvarChar(50) NOT NULL,
      ManagerKey INT NULL REferences Employee(EmployeeKey),
      OfficePhone VARCHAR(15) NULL ,
      CellPhone VARCHAR(15) NULL ,
      CreatedDate DateTime NOT NULL DEFAULT CURRENT_TIME,
      UpdatedDate DateTime NULL
      )

      CREATE UNIQUE INDEX index_name ON Employee(EmployeeId);






      sqlite






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 7 at 4:59









      Jonathan AllenJonathan Allen

      39.5k60203389




      39.5k60203389






















          1 Answer
          1






          active

          oldest

          votes


















          1














          EmployeeKey won't be shown as an index as it's an alias of the rowid column.



          • The rowid column being inherent for all tables that are not defined as WITHOUT ROWID tables.

          • The rowid column could be considered the MASTER index.

          If you were to not specify INTEGER PRIMARY KEY as the PRIMARY KEY, e.g. you specified EmployeeKey TEXT PRIMARY KEY, then an index would be listed as SQLite is quite specific about what constitutes an alias of the rowid (e.g. EmployeeKey INT PRIMARY KEY is not an alias of the rowid, so would have an index).



          You may wish to have a look at CREATE TABLE - Rowid.






          share|improve this answer
























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55036387%2fwhy-would-pragma-schema-index-listtable-name-not-show-primary-keys%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            EmployeeKey won't be shown as an index as it's an alias of the rowid column.



            • The rowid column being inherent for all tables that are not defined as WITHOUT ROWID tables.

            • The rowid column could be considered the MASTER index.

            If you were to not specify INTEGER PRIMARY KEY as the PRIMARY KEY, e.g. you specified EmployeeKey TEXT PRIMARY KEY, then an index would be listed as SQLite is quite specific about what constitutes an alias of the rowid (e.g. EmployeeKey INT PRIMARY KEY is not an alias of the rowid, so would have an index).



            You may wish to have a look at CREATE TABLE - Rowid.






            share|improve this answer





























              1














              EmployeeKey won't be shown as an index as it's an alias of the rowid column.



              • The rowid column being inherent for all tables that are not defined as WITHOUT ROWID tables.

              • The rowid column could be considered the MASTER index.

              If you were to not specify INTEGER PRIMARY KEY as the PRIMARY KEY, e.g. you specified EmployeeKey TEXT PRIMARY KEY, then an index would be listed as SQLite is quite specific about what constitutes an alias of the rowid (e.g. EmployeeKey INT PRIMARY KEY is not an alias of the rowid, so would have an index).



              You may wish to have a look at CREATE TABLE - Rowid.






              share|improve this answer



























                1












                1








                1







                EmployeeKey won't be shown as an index as it's an alias of the rowid column.



                • The rowid column being inherent for all tables that are not defined as WITHOUT ROWID tables.

                • The rowid column could be considered the MASTER index.

                If you were to not specify INTEGER PRIMARY KEY as the PRIMARY KEY, e.g. you specified EmployeeKey TEXT PRIMARY KEY, then an index would be listed as SQLite is quite specific about what constitutes an alias of the rowid (e.g. EmployeeKey INT PRIMARY KEY is not an alias of the rowid, so would have an index).



                You may wish to have a look at CREATE TABLE - Rowid.






                share|improve this answer















                EmployeeKey won't be shown as an index as it's an alias of the rowid column.



                • The rowid column being inherent for all tables that are not defined as WITHOUT ROWID tables.

                • The rowid column could be considered the MASTER index.

                If you were to not specify INTEGER PRIMARY KEY as the PRIMARY KEY, e.g. you specified EmployeeKey TEXT PRIMARY KEY, then an index would be listed as SQLite is quite specific about what constitutes an alias of the rowid (e.g. EmployeeKey INT PRIMARY KEY is not an alias of the rowid, so would have an index).



                You may wish to have a look at CREATE TABLE - Rowid.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Mar 7 at 5:34

























                answered Mar 7 at 5:28









                MikeTMikeT

                17.2k112643




                17.2k112643





























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid …


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55036387%2fwhy-would-pragma-schema-index-listtable-name-not-show-primary-keys%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Thal And Out Agency railway station See also References External links Navigation menuOfficial Web Site of Pakistan RailwaysArchivedOfficial Web Site of Pakistan Railwayseeexpanding ite

                    Can't find variable: document ReactNative Js2019 Community Moderator ElectionReactNative: how to center text?Can't find variable: navigate - ReactNative navigationReact Native error: “Can't find variable: TouchableHighlight”How to use Expo.DocumentPicker.getDocumentAsync properly. [Expo] [ReactNative]Can't find variable: regeneratorRuntime (ReactNative)Reactnative Expo It is advisable for a StartUp?Can't find variable : Self / Can't install firebaseNPM Install Error in installing ReactNative CLIContacts Displaying in App using ReactnativeFacebook login error: can't find variable: Alert

                    Posting a File and Associated Data to a RESTful WebService preferably as JSON2019 Community Moderator ElectionREST URI convention - Singular or plural name of resource while creating itUploading both data and files in one form using Ajax?How do I upload a file with metadata using a REST web service?REST API - file (ie images) processing - best practicesSpring: JSON data and file in the same requestREST API Put large dataPosting a file and JSON data to Spring rest serviceRESTful Web Service Upload/Download Large Data With JSONREST API Design sending JSON data and a file to the api in same requestPost JSONArray to REST servicePUT vs. POST in RESTParsing values from a JSON file?JavaScript/jQuery to download file via POST with JSON dataHow do I upload a file with metadata using a REST web service?How to POST JSON data with Curl from Terminal/Commandline to Test Spring REST?Separate REST JSON API server and client?what's the correct way to send a file from REST web service to client?How do I write JSON data to a file?What is “406-Not Acceptable Response” in HTTP?REST API - file (ie images) processing - best practices