Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0020371
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformmajoralways2012-04-27 12:312012-04-27 14:10
ReportermiruritaView Statuspublic 
Assigned Toalostale 
PriorityhighResolutionno change requiredFixed in Version
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabasePostgreSQLJava version
OS VersionDatabase versionAnt version
Product VersionpiSCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0020371: Unique constraint in PostgreSQL not working with nullable columns

Descriptionunique constraints containing nullable columns are not working as expected in PostgreSQL.

http://www.postgresql.org/docs/8.1/static/ddl-constraints.html [^]

"In general, a unique constraint is violated when there are two or more rows in the table where the values of all of the columns included in the constraint are equal. However, null values are not considered equal in this comparison. That means even in the presence of a unique constraint it is possible to store duplicate rows that contain a null value in at least one of the constrained columns. This behavior conforms to the SQL standard, but we have heard that other SQL databases may not follow this rule. So be careful when developing applications that are intended to be portable."
Steps To Reproduce[PostgreSQL]

c_conversion_rate_document table has the following unique constraint:
constraint c_conversionratedoc_once UNIQUE (c_currency_id, c_currency_id_to, c_invoice_id, fin_payment_id, aprm_finacc_transaction_v_id)

1) Create a new Sales Invoice
2) Go to Exchange Rates tab
3) Create new Exchange Rate (EUR --> EUR)
    - Currency: EUR
    - To Currency: EUR
4) Create again the same exchange rate for EUR --> EUR
    - Currency: EUR
    - To Currency: EUR
5) The unique constraint defined should not allow to create the record in step 4
6) The system allows to create a duplicate exchange rate.
Proposed SolutionSupport more complex constraints.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0020142 closedmirurita In Exchange Rate tab, in Sales Invoice Window, it allows to enter more than one exchange rate for the same pair of currencies. 

-  Notes
(0048148)
alostale (manager)
2012-04-27 14:10

Unique constraints in PostgreSQL do behave as they are expected to behave in PG (which might be differently than in Oracle).

- Issue History
Date Modified Username Field Change
2012-04-27 12:31 mirurita New Issue
2012-04-27 12:31 mirurita Assigned To => alostale
2012-04-27 12:31 mirurita Modules => Core
2012-04-27 12:33 mirurita Relationship added related to 0020142
2012-04-27 14:10 alostale Note Added: 0048148
2012-04-27 14:10 alostale Status new => closed
2012-04-27 14:10 alostale Resolution open => no change required


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker