could you clarify, why do you want to do this in C#? what to you mean by 'clone table'? – Roman Pekar20 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. – sandy20 hours ago
Do you mean postgresql inheritance, and you just executing SQL code from c#? – Roman Pekar20 hours ago
Yes I am executing code from c# – sandy20 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 Pekar19 hours ago
select * from information_schema.table_constraints where table_name = 'cities' and constraint_type in ('PRIMARY KEY', 'FOREIGN KEY')
– Roman Pekar 19 hours ago