Yes, I'm aware there is a question very similar to mine, the difference is that I want all constraints, including not null, which no answer is able to do.
PostgreSQL – How to List All Constraints of a Table by Schema
constraintpostgresql
Related Question
- Mysql – How to force MySQL Workbench to use constraints in the file
- PostgreSQL – How to CREATE TABLE LIKE Without NOT NULL Constraints?
- Oracle – SQL Error OA-12991 When Dropping Column After Removing Multi-Column Constraints
- PostgreSQL – How to Duplicate Constraints Between Tables with Identical Structure
- Query data that does not fulfill constraints in table in Oracle DB
Best Answer
Specifically for the "not null" part, thanks to
psql -E
to see what happens when you do\d+
, and adapted/simplified from it, the following works: