Open sjib opened 9 months ago
@3nids Is that documented correctly?
@3nids Question - how can you create indexes on a table that does not exist anymore?
The code removed was commented, the two indexes were already there. So no effective change on this file.
Regarding the documentation, I can't tell, I'll let you decide what to document or not.
I believe that any constraint should be deferrable initially deferred
in the datamodel.
I believe that any constraint should be deferrable initially deferred in the datamodel.
@ponceta @cymed Do you agree with this suggestion and should I add this to every relation constraint in the data model? Or is there a risk that we create other problems?
Upon creation, a constraint is given one of three characteristics: DEFERRABLE INITIALLY DEFERRED, DEFERRABLE INITIALLY IMMEDIATE, or NOT DEFERRABLE. The third class is always IMMEDIATE and is not affected by the SET CONSTRAINTS command. The first two classes start every transaction in the indicated mode, but their behavior can be changed within a transaction by SET CONSTRAINTS.
https://www.postgresql.org/docs/current/sql-set-constraints.html This seems to be a new thing that was introduced with Postgres 12.
As the road map https://github.com/teksi/Home/wiki/TEKSI-modules-releases-and-roadmap bases on Postgres 15 we should be in the ragen of +/-1 versions that support this
I am not deep enough into the deferring to tell whether all will work as expected
With https://github.com/teksi/wastewater/pull/137/files a new way of handling n-m relations is introduced
Set relations DEFERRABLE INITIALLY DEFERRED
and
and instead of re_table
two indexes are created: