Ctrl-Click-Drag columns from one table to another in an ERD

I don’t know if this is a bug or something I am doing incorrectly (or not doing something).
I searched existing topics and did not find this situation addressed.

Steps:

  • In an ERD diagram, I select a few columns from a table.
  • I Control-Click and then drag and drop onto another table.
  • All good, the columns are copied over.
  • I then go to each copied column in the target table, press F2 and rename them.
  • I rename the columns and press enter after each. The diagram displays the new names - good.

When I right click on the table and click Generate SQL, I get the old column names generated.

I closed and exited VP and restarted and loaded the same model. Nothing has changed.
I even tried Right Click on the table header and selected Move/Copy columns.
In the dialog I select one column to copy to the new table. It is copied fine.
Then I try to edit the name with F2 as above. The edit is fine but the Generatye SQL shows the column name pre-edit.

What am I missing here? Does Copy not actually make a copy but instead produces a reference?
I am using VP Standard 17.2 Build 20250123 on Windows 11.

Update:
The diagram was set to Data Model: Logical. Thinking this might be the problem, I changed it to Physical, deleted the table I was working on, created a new table and still I was getting column name like this:

CREATE TABLE Comparison_Operator (
Column2 uuid NOT NULL,
“Column” varchar(100) NOT NULL,
Column3 int4 NOT NULL,
PRIMARY KEY (Column2));

even though on the ER diagram, they have the names I typed as above.

Update:
When I right click on the table (table header) in the diagram and click on Open Specification and then click Columns and then Add, the column names I type are kept and show up correctly in the Generate SQL. I view this a WORKAROUND. If you allow copy and drag on the ER diagram (which speeds modelling), why doesn’t it work the same way?

I just tested with the same build but cannot repeat the problem you experienced. I’ve captured a video about my steps. Would you please have a look and see is there any different with your steps?

Thanks Rain for looking into this.
I think there is one more factor that comes into play here.
The table I am modifying was loaded into VP via DB reverse engineering - it was a DDL file, not a database.
The model explorer reflects the changed column names.
However, you can see from the diagram view, the original name pops up.
I checked all the settings for reverse DDL and I didn’t see any setting that might affect this.
Thanks in advance for any new insights or suggestions.

Workaround 1:
This is far too time consuming, but I can delete the columns and add new columns. This is like negating the whole value of reversing DDL.

Workaround 2:
I can edit the original DDL file and reload (re-reverse) it. This appears to rename the columns as I desire. Marginallyt better than Workaround 1 but I’d like to edit in the diagram.

Thanks for replying. Having entities reverse from DDL actually make no differences. It just same as an entity directly create from diagram. But your latest screenshot to point out the cause of the problem you experiencing. It is just because your project do have nickname defined (Modeling > Nickname), while you are renaming the column on the nickname layer instead of the original name layer. Since DDL generation will only consider the info from original layer, this explains why you renamed the column (in nickname layer) but generated DDL having different column name (from original layer). For your case please make sure you switch to original name layer before make change to the copied columns.

Feel free to contact me for any questions.

OMG you found the cause. Thank you so much. I removed the nickname and now everything works as expected. I don’t know VP well enough yet to have found this. I am glad we have experts like you answering questions. Take care.

1 Like