Why can't I set primary key for table created by SELECT?

I can create a simple table by using SELECT. With that table I can’t set a primary key. I can copy that table and paste it back into my table list, giving it a new name, and I can select a primary key in the process. What makes these two tables behave differently?

As an example, I can manually create a table as shown in this imagestructure and populate it with simple data, as seen herefield entries. With it I can turn on and off the primary key with no problem. I can then do SELECT “recid”,“title” INTO TEXT “newtable” FROM “oldtable”. The “newtable” will not have a primary key and I can’t create one. I could then copy “newtable” and paste it to “newertable”. While doing so I can select field “recid” to be primary key. With “newertable” I can edit it and turn primary key off and on at will.

I am using LO 7.1.0.3 with embedded HSQLDB, on a Mac computer with OSX Catalina (10.16.7).

An email from Ratlinger reminded me that I was creating a text file, in CSV format, with SELECT “recid”,“title” INTO TEXT “newtable” FROM “oldtable”. To create a primary key for this, the answer is to do 'SET SOURCE ‘newtable" OFF’. I can then edit the table definition and set a primary key (e.g. “recid”). I then have to use “SET newtable SOURCE filename” to get reconnected to the text file that was created. At that point I can view the table contents and modify them–as desired.

@wehmann12,

Did withdraw my original post as I was not satisfied with the answer. The documentation does state the ability to add a primary key. Will probably look further into this some time if for nothing else but my own better understanding. Will post here if there is any significant differences than already noted.