Dear KNIMErs,
I am trying to edit a PostgreSQL database with KNIME and I am struggling with the DB rename node. While the DB renaming node is assigning a new name to the appropriate column I cannot write it permanently into the database. When using the DB writer node this returns the message “column xxx or relation yyy” does not exist (where xxx is the new column name and yyy the database table). If I read the DB it still has the old name. The only workaround I found is to delete the database and create it newly. But perhaps there is another way or I did not understand the concept behind and need another way to rename database columns. Thanks for your help in advance.
I have attached a screenshot of the workflow that I used to rename the DB column.
Stefan
Hi Stefan,
The node DB renaming is for just make a “copy” or “manipulate” the data to use on Knime flow, not direct at the database. If you need to execute a SQL command, use de DB Executor node, because it’ll say to your database de SQL command that you put there… rename, select, insert… whatever you need that the database do.
Is it clear for you?
Seeya,
Denis
2 Likes
Hi Denis, thanks for the clarification,
I used the DB SQL executor with the syntax
ALTER TABLE table_name
CHANGE COLUMN oldcolumn_name to newcolumn_name;
This was working!
Kind regards
Stefan
1 Like
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.