pgquarrel
pgquarrel copied to clipboard
Group `CREATE TABLE` statements
When some tables reference each other through foreign keys it would be good to first issue CREATE TABLE
statements and then, once all tables had been created, add any constraints/foreign keys.
There is more fundamental issue with statements generated by the tool that rely each on other.
Example - I can have some functions that operate on tables and some other functions that I then use to build indexes and if order of CREATE statements is incorrect then the script will fail.
Not to mention one function may depend on another function.
@grzegorzk did you solve this case?
I have similar issue: table_child
references table_parent
with foreign key but table_child
is created first and then table_parent