I'm having the following issue with QGIS. Adding a sqlite text table (Layer > Add Vector Table) QGIS hides the primary key field (having name id). I understand also QGIS uses this field as unique id, but I need to have it in the attribute view because all my links and joins use this field. I'm not able actually to perform a join with my vector tables. I can neither change the column names, nor create views.

  • can you share a sample of your data? Aug 18, 2012 at 15:48
  • I'll send a message to the qgis uselist with zip attached containing qgis project file & sqlite database, already loaded in the project. Opening attribute table in qgis no id field is shown. If you open the database with another software you'll see the table ha two fields, the first named id and set as primary key Aug 18, 2012 at 21:41
  • Hi, it's not a spatialite db I want to add to my project, but a simple text table. I need to load external attributes from plain text tables and join with my vector layers. I'll not be able to perform the join until ID fields does not show up. I think that the missing ID field should be considered a bug, because we should be able to manage external data as they are, without filters. Aug 19, 2012 at 8:16
  • @AndreJoost Could you post your comment as an answer?
    – underdark
    Dec 18, 2012 at 20:28

2 Answers 2


Although your question has already been answered in the comments. Why don't just add a new field to the attribute-table with the same name and select $id (or $rownum) as input in the field-calculator?

Something like this: enter image description here


I could analyze your problem a bit:


Adding the table to a sqlite database with already existing geometry tables solved the problem. And I used Add sqlite database (geometryless), not Add vector table.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.