Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

postgres: can I declare functional dependencies?

Tags:

sql

postgresql

If, for a given table, the value of a column c is determined by the values of columns (a, b), is there a way to declare this fact to postgres??

I'm asking because the examples given for group by mention that, if you group by the primary key, you can use any other column of the table in the select-list, because it will be functionally dependent on the primary key. However, I have not been able to find anything in the documentation that extends this to other columns or column combinations.

like image 363
blue_note Avatar asked Aug 31 '25 04:08

blue_note


1 Answers

No, feature that you want is not supported now (2020).

like image 195
Pavel Stehule Avatar answered Sep 02 '25 18:09

Pavel Stehule