pgquarrel icon indicating copy to clipboard operation
pgquarrel copied to clipboard

Group `CREATE TABLE` statements

Open grzegorzk opened this issue 5 years ago • 2 comments

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.

grzegorzk avatar Jun 26 '19 14:06 grzegorzk

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 avatar Jul 01 '19 07:07 grzegorzk

@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

hazardland avatar Mar 25 '21 18:03 hazardland