Opened 4 years ago
Closed 4 years ago
#4905 closed defect (fixed)
Revise shp2pgsql regress tests to properly test -Z
Reported by: | robe | Owned by: | stefanpetrea |
---|---|---|---|
Priority: | low | Milestone: | PostGIS 3.2.0 |
Component: | utils/loader-dumper | Version: | master |
Keywords: | Cc: |
Description
shp2pgsql ultimately generates an SQL output fed directly to psql.
Our shp2pgsql tests never output this SQL to compare against an expected. As a result #4628 could not be tested with it to confirm the ANALYZE
line is not there since the result of database table created would be the same even without output. I think same holds for Index, but have to double-check that.
Change History (6)
comment:1 by , 4 years ago
Owner: | changed from | to
---|
comment:2 by , 4 years ago
Owner: | changed from | to
---|
comment:3 by , 4 years ago
comment:4 by , 4 years ago
Okay, I've discussed with strk. The approach in PR 611 is to test if the SQL generated by the loader contains ANALYZE statements. This was done by modifying the run_test.pl Perl script.
There is another approach, which is to verify that no ANALYZE were run on the database by checking the system catalogs to see if the table statistics are up-to-date. I've discussed this with Sandro (@strk) and he likes this more than the previous approach.
Please review PR 612.
Note: There is a corner-case that we have to handle in the new approach, which is to not let autovacuum run on the tables in the test suite, so we're disabling autovacuum for those.
comment:5 by , 4 years ago
Summary: | Revise shp2pgsql regress tests to include checking sql output → Revise shp2pgsql regress tests to properly test -Z |
---|
Currently, the SQL output generated by shp2pgsql is generated in a file but it's overwritten every time a new loader test is run.
In this pull request, a check is now in place if -Z was among the parameters passed to the loader, in which case, the generated SQL is checked for ANALYZE statements, and we expect there to be zero such statements there.
Please review pull request 611