You can translate the question and the replies:

Constraints are not working with materialized table

I found something when I tried executing the materialized table. After I create a table with primary key constraint, If I insert a repeated value the server is accepting and inserting two rows with same value even if primary key is specified? Can anyone answer to this question?
user
07-04-2022 05:26:21 -0400
code

1 Answer

Hi, In Denodo Platform, primary keys can be defined for views and it is always recommended to define primary keys in order to improve the performance. However, the Virtual DataPort Server does not enforce the primary key definitions and so there is no guarantee that a column marked as primary key has unique values. The responsibility of uniqueness relies on the data source. You could refer to the **[Primary Keys of Views](https://community.denodo.com/docs/html/browse/latest/en/vdp/administration/restful_architecture/primary_keys_of_views/primary_keys_of_views#primary-keys-of-views)** section of the Virtual DataPort Administration Guide for more information. You could also read a similar Q&A answer [**here**](https://community.denodo.com/answers/question/details?questionId=9060g0000000AEuAAM&title=Enforcing+primary+key). Hope this helps!
Denodo Team
07-04-2022 07:32:13 -0400
code
You must sign in to add an answer. If you do not have an account, you can register here