Database Writer: Reserved word as column name

Hello everyone,

I have a table with a column named "end" which consists of timestamp indicating the end of an event. However, it seems like "end" is a reserved word for PostgreSQL, therefore I am getting syntax error whenever I want to write the table using Database Writer into my database. The problem is, the plug-in which I am using in my Web App to visualise the data needs the column to be named "end". So, how can I solve this problem?

Thank you :)



Probably there is not a direct solution, but you can use some "workaround" to solve your problem. If you have privilages to use "ALTER TABLE", you can do this:

1. USE "Database SQL Executor" with SQL STATEMENT: ALTER TABLE <your_table_name> RENAME COLUMN "end" TO <end>.

2. In Knime use "rename" node and change "end" column name to <and>.

3. Use database writer.

4. USE "Database SQL Executor" with SQL STATEMENT: ALTER TABLE <your_table_name> RENAME COLUMN <end> TO "end".

It should work.

Another (probably simpler and "cleaner") solution is creating VIEW in your database. Of course, if view can be used as a source for your Web-app plugin. You can do simple things:

1. Create table without reserved word like "end", for example end_time.

2. Create VIEW with alias in select statement:

CREATE VIEW my_view AS SELECT end_time AS "end" FROM <your_table_name>

If KNIME is planing to support reserved words in a future?

It seems as dead end.

Yes, we do plan to support quoted columns (which also allows to use keywords as names). However this will be an incompatible change therefore we must take extreme care not to break existing workflows. Therefore this will take some time.

Hope that quoted column will be supported soon.
I was able to modify the plug-in to use another column with another name instead of "end", so now my problem is solved. Thanks for the suggested solutions :)