1

I am trying to find if a constraint name is 'system generated' or 'manually given at the time of creation'.

MS SQL Server has a column 'is_system_named' in sys.key_constraints:

1 = Name was generated by system.
0 = Name was supplied by the user.

I tried to find similar in information_schema.table_constraints. Could not find it.

Use case is basically while migrating the databases, if manually named constraints are present then it will be easy to verify.

1 Answer 1

1

There is nothing of the sort in the relevant system catalog pg_constraint.

You can check the default naming pattern and if you see a different name, you can be sure it has been named explicitly. Other than that, I don't think you can tell for sure.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.