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

                    Understanding generators in Python2019 Community Moderator ElectionGenerator function not working pythonFor loop not executing two timesGenerators - Printing generated valuesWhy can a python generator only be used once?What exactly do generators do?What does the “yield” keyword do?What does “list comprehension” mean? How does it work and how can I use it?sklearn Kfold acces single fold instead of for loopIs a generator the callable? Which is the generator?Apply Border To Range Of Cells Using OpenpyxlCalling an external command in PythonWhat are metaclasses in Python?What is the difference between @staticmethod and @classmethod?Finding the index of an item given a list containing it in PythonDifference between append vs. extend list methods in PythonHow can I safely create a nested directory in Python?Does Python have a ternary conditional operator?Understanding slice notationUnderstanding Python super() with __init__() methodsDoes Python have a string 'contains' substring method?

                    How can I change the color of pagination dots of UIPageControl?How to change UIPageControl dotsIs there a way to change page indicator dots colorCustomize dot with image of UIPageControl at index 0 of UIPageControlNo visible @interface for 'NSObject<PageControlDelegate>' declares the selector 'pageControlPageDidChange:'How to change the color of pagination dots in UIPageControl with a different color per pagepagecontrol indicator custom image instead of DefaultChanging the colour of UIPageControl dots in MonoTouchpagecontrol selectable page visibility color?Alternative way to load ViewControllers on a UIPageControlHow to set only layer.border-color for UIpage control dots in swiftHow can I develop for iPhone using a Windows development machine?How to change the name of an iOS app?UITableView - change section header coloruipagecontrol indicator(dot)issueCustom UIPageControl dots color not changingchange the interspace between UIPageControl dotsHow to change Status Bar text color in iOSHow can I change image tintColor in iOS and WatchKitUIPageControl dots with larger space in between each dotsHow to change the color of pagination dots in UIPageControl with a different color per page