On 2016-02-10 10:53:28 +0000, gsv371@ukr.net wrote:
> PostgreSQL 9.5:
> 1.
> ALTER TABLE schedule ADD CONSTRAINT schedule_fact_quant_val CHECK
> (fact_quant BETWEEN 0 AND 23.59 AND (fact_quant - trunc(fact_quant)) <
> 0.6);
> result (pg_constraint.consrc): "(((fact_quant >= (0)::numeric) AND
> (fact_quant <= 23.59)) AND ((fact_quant - trunc(fact_quant)) < 0.6))"
> 2.
> ALTER TABLE schedule ADD CONSTRAINT schedule_fact_quant_val CHECK
> (((fact_quant >= (0)::numeric) AND (fact_quant <= 23.59)) AND ((fact_quant -
> trunc(fact_quant)) < 0.6));
> result (pg_constraint.consrc): "((fact_quant >= (0)::numeric) AND
> (fact_quant <= 23.59) AND ((fact_quant - trunc(fact_quant)) < 0.6))"
> ----------------------------------
> PostgreSQL 9.4 - identical results!
Why do you consider that a bug?
Regards,
Andres
Hi,justsorryfor my english, it'sGoogletranslator. This is the reasonthe lack ofdetailed description of theproblemsdiscussedin"bug". Maybe it'snot a bugin the truest sense.
There is aprocess:
In the emptybasecreates the necessarydata structure. Then, based onthe contentsof thetables "pg_catalog"obtainandmaintainthe description ofthis structure(snapshot). In the future,comparingthe(snapshot)with another(snapshot)receivedfromthe production database, a decisionabout the difference betweenthe structures andthe need to transformthe production database.
The essence ofthe problem : Developercreates check constrait according to [1]describe thebug. Inreference (snapshot)to store the resultof[1]describe thebug.
Theproduction databaseismissingthe check constraintand the decisionof itscreation. Addinstructionis generated fromthe reference(snapshot) and corresponds to[2]describe thebug.
Afterthis addition,we obtain check constraitwhich is functionally equivalentto the reference,but differsfrom the descriptionofthe reference.
And this inturn causes are-creationcheck constrait foreach ofthe subsequent verification ofthe production databasestructure.