File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Orm/Xtensive.Orm.PostgreSql/Orm.Providers.PostgreSql Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -18,15 +18,24 @@ namespace Xtensive.Orm.Providers.PostgreSql
1818 /// </summary>
1919 public class DomainHandler : Providers . DomainHandler
2020 {
21+ /// <summary>
22+ /// <see langword="true"/> if storage can trim insignificant zeros in numeric values
23+ /// </summary>
24+ protected bool HasNativeTrimOfInsignificantDecimalPoints =>
25+ Handlers . ProviderInfo . StorageVersion . Major < 13 ;
26+
2127 /// <inheritdoc/>
2228 protected override ICompiler CreateCompiler ( CompilerConfiguration configuration ) =>
2329 new SqlCompiler ( Handlers , configuration ) ;
2430
2531 /// <inheritdoc/>
2632 protected override IPreCompiler CreatePreCompiler ( CompilerConfiguration configuration )
2733 {
28- var decimalAggregateCorrector = new AggregateOverDecimalColumnCorrector ( Handlers . Domain . Model ) ;
29- return new CompositePreCompiler ( decimalAggregateCorrector , base . CreatePreCompiler ( configuration ) ) ;
34+ if ( HasNativeTrimOfInsignificantDecimalPoints ) {
35+ var decimalAggregateCorrector = new AggregateOverDecimalColumnCorrector ( Handlers . Domain . Model ) ;
36+ return new CompositePreCompiler ( decimalAggregateCorrector , base . CreatePreCompiler ( configuration ) ) ;
37+ }
38+ return base . CreatePreCompiler ( configuration ) ;
3039 }
3140
3241 /// <inheritdoc/>
You can’t perform that action at this time.
0 commit comments