Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am cloning database table in postgresql using c#.now I also want to add constraints to newly created table.

can anyone suggest way to add constraints dynamically?

I want to add all constraints from table I've clone

thanks

share|improve this question
could you clarify, why do you want to do this in C#? what to you mean by 'clone table'? – Roman Pekar 20 hours ago
I am creating table using inheritance via c# code.so now after inheriting table I also want to add constraints from base table - from which I am inheriting another table - so how can I add constraint dynamically. – sandy 20 hours ago
Do you mean postgresql inheritance, and you just executing SQL code from c#? – Roman Pekar 20 hours ago
Yes I am executing code from c# – sandy 20 hours ago
you can generate scripts by yourself - select * from information_schema.table_constraints where table_name = 'cities' and constraint_type in ('PRIMARY KEY', 'FOREIGN KEY') – Roman Pekar 19 hours ago

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.