I have a piece of
SQL that creates a
TABLE form a
SELECT statement in PostgreSQL ; I want to add constraints to the table so that for example a column cannot be
I cannot find valid SQL for this in the Postgres Documentation, so it seems it is not possible.
What would be the best approach to achieve this kind of functionality? I would like creation of the table to fail if the constraint is violated.
I cannot create the table with the constraint beforehand because there might be some variation in some of the columns, as they are the result of a dynamic process.