[postgis-tickets] [SCM] PostGIS branch master updated. 3.3.0rc2-648-g87df5a875
git at osgeo.org
git at osgeo.org
Mon Feb 20 18:23:09 PST 2023
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".
The branch, master has been updated
via 87df5a875dcbc88fdeb84a85c0d9b2c648a71eae (commit)
via b0b44db3c95e0c73c1adaca97a5dddc8c36ff0c8 (commit)
via 4505b2c17786db41b0e36da0fa0e90d05ba0bd8e (commit)
via ef8f92d99b7a5b086b3c365efc1d4e95951fb9b6 (commit)
from 8de396392c0e892c00e9cf04f8599c6e91d4c7e9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 87df5a875dcbc88fdeb84a85c0d9b2c648a71eae
Author: Sandro Santilli <strk at kbt.io>
Date: Tue Feb 21 03:21:24 2023 +0100
run_test.pl: print where script-based upgrade is being done from
diff --git a/regress/run_test.pl b/regress/run_test.pl
index ab1b4f8ec..543eb7d64 100755
--- a/regress/run_test.pl
+++ b/regress/run_test.pl
@@ -1705,7 +1705,10 @@ sub package_extension_sql
# Upgrade an existing database (soft upgrade)
sub upgrade_spatial
{
- print "Upgrading PostGIS in '${DB}' \n" ;
+ my $version = shift;
+ my $scriptdir = scriptdir($version);
+
+ print "Upgrading PostGIS in '${DB}' using scripts from $scriptdir\n" ;
my $script = "${STAGED_SCRIPTS_DIR}/postgis_upgrade.sql";
print "Upgrading core\n";
commit b0b44db3c95e0c73c1adaca97a5dddc8c36ff0c8
Author: Sandro Santilli <strk at kbt.io>
Date: Tue Feb 21 03:11:21 2023 +0100
Before upgrade hook of testsuite don't need to deal with dumprestore
... as it's always run AFTER dump and restore
diff --git a/regress/hooks/hook-before-upgrade.sql b/regress/hooks/hook-before-upgrade.sql
index 40287a78d..c156548a9 100644
--- a/regress/hooks/hook-before-upgrade.sql
+++ b/regress/hooks/hook-before-upgrade.sql
@@ -68,21 +68,7 @@ FROM upgrade_test;
-- Break probin of all postgis functions, as we expect
-- the upgrade procedure to replace them all
UPDATE pg_proc SET probin = probin || '-uninstalled'
-WHERE probin like '%postgis%'
--- When testing dump/restore keep the type-output
--- function as they are needed for pg_dump
-AND (
- :opt_dumprestore = 0 OR
- oid NOT IN (
- SELECT typoutput
- FROM pg_type
- WHERE typname IN ( 'geometry', 'geography', 'raster' )
- UNION ALL
- SELECT typmodout
- FROM pg_type
- WHERE typname IN ( 'geometry', 'geography', 'raster' )
- )
-);
+WHERE probin like '%postgis%';
-- Change SECURITY of postgis_version() to DEFINER
commit 4505b2c17786db41b0e36da0fa0e90d05ba0bd8e
Author: Sandro Santilli <strk at kbt.io>
Date: Tue Feb 21 03:10:06 2023 +0100
run_test.pl: prepare restore db only if needed, add pre-dump and post-restore hooks
diff --git a/regress/run_test.pl b/regress/run_test.pl
index ab0d7ea66..ab1b4f8ec 100755
--- a/regress/run_test.pl
+++ b/regress/run_test.pl
@@ -79,6 +79,8 @@ my $OPT_WITH_SFCGAL = 0;
my $OPT_EXPECT = 0;
my $OPT_EXTENSIONS = 0;
my @OPT_HOOK_AFTER_CREATE;
+my @OPT_HOOK_AFTER_RESTORE;
+my @OPT_HOOK_BEFORE_DUMP;
my @OPT_HOOK_BEFORE_TEST;
my @OPT_HOOK_AFTER_TEST;
my @OPT_HOOK_BEFORE_UNINSTALL;
@@ -112,7 +114,9 @@ GetOptions (
'before-uninstall-script=s' => \@OPT_HOOK_BEFORE_UNINSTALL,
'before-test-script=s' => \@OPT_HOOK_BEFORE_TEST,
'before-upgrade-script=s' => \@OPT_HOOK_BEFORE_UPGRADE,
- 'after-upgrade-script=s' => \@OPT_HOOK_AFTER_UPGRADE
+ 'before-dump-script=s' => \@OPT_HOOK_BEFORE_DUMP,
+ 'after-upgrade-script=s' => \@OPT_HOOK_AFTER_UPGRADE,
+ 'after-restore-script=s' => \@OPT_HOOK_AFTER_RESTORE
);
if ( @ARGV < 1 )
@@ -686,6 +690,12 @@ Options:
--before-uninstall-script <path>
script to load before spatial extension uninstall
(multiple switches supported, to be run in given order)
+ --before-dump-script <path>
+ script to load before dump, if --dumprestore is given
+ (multiple switches supported, to be run in given order)
+ --after-restore-script <path>
+ script to load after restore, if --dumprestore is given
+ (multiple switches supported, to be run in given order)
--before-upgrade-script <path>
script to load before upgrade
(multiple switches supported, to be run in given order)
@@ -2015,6 +2025,12 @@ sub dump_db
my $rv;
my $DBDUMP = $TMPDIR . '/' . $DB . '.dump';
+ foreach my $hook (@OPT_HOOK_BEFORE_DUMP)
+ {
+ print "Running before-dump-script $hook\n";
+ die unless load_sql_file($hook, 1);
+ }
+
print "Dumping database '${DB}'\n";
$rv = system("pg_dump -Fc -f${DBDUMP} ${DB} >> $REGRESS_LOG 2>&1");
@@ -2030,20 +2046,20 @@ sub restore_db
{
my $rv;
my $DBDUMP = shift;
+ my $ext_dump = $OPT_EXTENSIONS && $OPT_UPGRADE_FROM !~ /^unpackaged/;
- # If the dump is NOT extension based
+ # If dump is not from extension-based database
# we need to prepare the target
- if ( $OPT_UPGRADE_FROM =~ /^unpackaged/ || ! $OPT_EXTENSIONS )
+ unless ( $ext_dump )
{
- if ( $OPT_EXTENSIONS ) {
- undef($OPT_UPGRADE_FROM); # to directly prepare the target
- die unless prepare_spatial_extensions();
- } else {
- die unless prepare_spatial();
+ if ( $OPT_UPGRADE_FROM =~ /^unpackaged(.*)/ ) {
+ die unless prepare_spatial($1);
+ } else {
+ die unless prepare_spatial();
}
}
- if ( $OPT_EXTENSIONS && ! $OPT_UPGRADE_FROM =~ /^unpackaged/ ) {
+ if ( $ext_dump ) {
print "Restoring database '${DB}' using pg_restore\n";
$rv = system("pg_restore -d ${DB} ${DBDUMP} >> $REGRESS_LOG 2>&1");
} else {
@@ -2069,6 +2085,12 @@ sub restore_db
}
}
+ foreach my $hook (@OPT_HOOK_AFTER_RESTORE)
+ {
+ print "Running after-restore-script $hook\n";
+ die unless load_sql_file($hook, 1);
+ }
+
return 1;
}
commit ef8f92d99b7a5b086b3c365efc1d4e95951fb9b6
Author: Sandro Santilli <strk at kbt.io>
Date: Tue Feb 21 01:49:19 2023 +0100
run_test.pl: do not skip upgrade with --dumprestore and --upgrade
Otherwise pre-upgrade scripts will break the functions and nothing
would recover it
diff --git a/regress/run_test.pl b/regress/run_test.pl
index f1e883c93..ab0d7ea66 100755
--- a/regress/run_test.pl
+++ b/regress/run_test.pl
@@ -410,16 +410,13 @@ if ( $OPT_UPGRADE )
die unless load_sql_file($hook, 1);
}
- unless ( $OPT_DUMPRESTORE )
+ if ( $OPT_EXTENSIONS )
{
- if ( $OPT_EXTENSIONS )
- {
- die unless upgrade_spatial_extensions();
- }
- else
- {
- die unless upgrade_spatial();
- }
+ die unless upgrade_spatial_extensions();
+ }
+ else
+ {
+ die unless upgrade_spatial();
}
foreach my $hook (@OPT_HOOK_AFTER_UPGRADE)
-----------------------------------------------------------------------
Summary of changes:
regress/hooks/hook-before-upgrade.sql | 16 +---------
regress/run_test.pl | 60 ++++++++++++++++++++++++-----------
2 files changed, 42 insertions(+), 34 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list