I have a function that does insert
in a table. This table has two columns that are unique 'email' and 'login'. In other tables there are also unique
composite keys.
Therefore, a UNIQUE_VIOLATION code: 23505
exception can happen if you try to insert repeated data into any of the columns that are constrained by unique
keys.
Question:
- How do I capture which of the
unique
keys were violated, when there is more than one in the same table, type to return the name of it, or do some procedure based on that?