eulerto / pgquarrel

pgquarrel compares PostgreSQL database schemas (DDL)
BSD 3-Clause "New" or "Revised" License
389 stars 42 forks source link

improvements in order of columns in new tables, quotes in privileges,… #62

Closed rafaelsagastume closed 4 years ago

rafaelsagastume commented 5 years ago

… comparison of improved views, list of executed changes, among others.

Good day, eulerto. With all the respect they deserve, I present some improvements, which can solve some open issues.

The order of the columns when a table is completely new: make the change on table.c, in the queries that bring the columns but with the non-alphabetical numerical order that was previously.

In some databases, the groups type them with uppercase letters at the beginning, for example Admin, but these types of arguments are not recognized, therefore enclosing them in inverted commas leaving this way:

GRANT INSERT, SELECT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER ON TABLE schema.table TO "Administration";

Modify both the process of materialized views, such as the views, so that it detects changes within the body of the views, modifications if within the body of the view they add or enrich the query.

I took the audacity to modify printSummary (), adding the objects that were pending display.

eulerto commented 5 years ago

@rafaelsagastume Hi! First of all thanks for your effort in improving pgquarrel.

The order of the columns when a table is completely new: make the change on table.c, in the queries that bring the columns but with the non-alphabetical numerical order that was previously.

That is an open issue #61 .

In some databases, the groups type them with uppercase letters at the beginning, for example Admin, but these types of arguments are not recognized, therefore enclosing them in inverted commas leaving this way:

Ops. That is definitely a bug. However, I think the right way to fix it is to create a new function that encapsulates that logic (use formatObjectIdentifier). It should only add quotes if needed.

Modify both the process of materialized views, such as the views, so that it detects changes within the body of the views, modifications if within the body of the view they add or enrich the query.

Did you see another issue #40 . I didn't look at your modifications but it seems to fragile to generate commands that could cause errors. Check that issue.

I took the audacity to modify printSummary (), adding the objects that were pending display.

Fine.

You implement a lot of features/fixes in the same PR. For the archive's sake, one feature/fix per PR. Could you do that? I'm happy to review and apply the PRs.

rafaelsagastume commented 5 years ago

thank you very much for the feedback, I will order and send you the changes