Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » Multiple DUAL_UNIQUE generate conflicting statements
Multiple DUAL_UNIQUE generate conflicting statements [message #49869] Wed, 23 May 2018 11:36 Go to next message
busiek is currently offline  busiek
Messages: 43
Registered: February 2011
Location: Poland
Member
This is a problem for PostgreSQL backend for sure.
TABLE(T)
    ...
    DUAL_UNIQUE(A, B)
    DUAL_UNIQUE(C, D)
END_TABLE

will generate A_script.sql containing:
...
alter table T add constraint DQ_T unique (A, B);
alter table T add constraint DQ_T unique (C, D);

Constraint names should be unique. The way to fix it is to add column names to the constraint name separated by some special symbol.
Re: Multiple DUAL_UNIQUE generate conflicting statements [message #50047 is a reply to message #49869] Wed, 27 June 2018 10:35 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 11701
Registered: November 2005
Ultimate Member
What about using UNIQUE_LIST instead?
Re: Multiple DUAL_UNIQUE generate conflicting statements [message #50048 is a reply to message #49869] Wed, 27 June 2018 15:50 Go to previous message
busiek is currently offline  busiek
Messages: 43
Registered: February 2011
Location: Poland
Member
Thanks, in UNIQUE_LIST you can name a constraint. I wasn't aware of that. I will use it.

Until now, I simply run A_script.sql manually, by editing the name of conflicting constraint.
Previous Topic: Implementing PostgreSql returning statement
Next Topic: PostgreSQL NaN fetching from DB
Goto Forum:
  


Current Time: Tue Feb 19 09:28:27 CET 2019

Total time taken to generate the page: 0.00679 seconds