Peter Eisentraut
08da2d282f
Add pg_upgrade test suite
...
It runs the regression tests, runs pg_upgrade on the populated
database, and compares the before and after dumps. While not actually
a cross-version upgrade, this does detect omissions and bugs in the
involved tools from time to time. It's also possible to do a
cross-version upgrade by manually supplying parameters.
2011-11-27 22:42:32 +02:00
Bruce Momjian
32fb4546e3
Remove ENABLE_SAME_CATVERSION_UPGRADES as unnecessary.
2011-11-25 19:08:41 -05:00
Bruce Momjian
5df1403b0f
Add pg_upgrade ENABLE_SAME_CATVERSION_UPGRADES macro for testing to
...
allow upgrades of the same catalog version. (Doesn't work for
tablespaces, as indicated by C comment.)
2011-11-23 22:51:45 -05:00
Bruce Momjian
7012b5edb7
Remove scandir() requirement in pg_upgrade; instead just use readdir()
...
--- we were not using the scandir pattern filtering anyway. This also
removes the scandir requirement in configure.
2011-11-17 21:59:49 -05:00
Bruce Momjian
ee3ef8f30c
Fix pg_upgrade's pg_scandir_internal() the right way. Backpatch to 9.1.
2011-11-17 13:40:44 -05:00
Bruce Momjian
988f907d24
Fix pg_upgrade's pg_scandir_internal() to properly handle a NULL
...
pattern, which is used on PG 9.1 and HEAD (but not pre-9.1). Fixes
crash on Windows.
Backpatched to 9.1.
Reported by Mark Dilger
2011-11-17 13:24:54 -05:00
Bruce Momjian
b735757c32
Remove pg_upgrade function no longer called (dir_matching_filenames).
2011-11-17 13:17:33 -05:00
Robert Haas
b76c61f1e8
Silence bogus compiler warning.
2011-11-04 10:40:52 -04:00
Robert Haas
c9f48b572c
Check the return value of getcwd(), instead of assuming success.
...
Kevin Grittner
2011-11-04 10:40:25 -04:00
Bruce Momjian
84b8fcaa92
Adjust pg_upgrade "new database skip" code, e.g. 'postgres', to more
...
cleanly handle old/new database mismatches.
2011-11-03 13:57:52 -04:00
Bruce Momjian
09d1174e5a
Update pg_upgrade comment on missing 'postgres' database.
2011-11-01 14:34:35 -04:00
Bruce Momjian
a50d860ae1
Allow pg_upgrade to upgrade an old cluster that doesn't have a
...
'postgres' database.
2011-11-01 13:49:48 -04:00
Bruce Momjian
51eba98cf4
Remove pg_upgrade dependency on the 'postgres' database existing in the
...
new cluster. vacuumdb, used by pg_upgrade, still has this dependency.
2011-10-28 21:19:21 -04:00
Bruce Momjian
9846dcfb9e
Clarify pg_upgrade error message that the 'postgres' database must exist
...
in the old cluster.
2011-10-28 08:09:15 -04:00
Bruce Momjian
38f3c7c4dd
Update pg_upgrade testing instructions.
2011-10-27 21:29:03 -04:00
Bruce Momjian
0dc3f57ba0
In pg_upgrade, add -o/-O options to pass parameters to the servers, and
...
document its use for config-only directory installs.
2011-10-10 07:44:11 -04:00
Bruce Momjian
caa1054df8
In pg_upgrade, use the new postmaster -C option to get the real data
...
directory, for config-only directory installs. Only works for PG 9.2+
servers.
2011-10-07 14:40:23 -04:00
Bruce Momjian
a3996754cc
In pg_upgrade, improve popen() failure detection by checking for fgets()
...
failures.
2011-10-06 19:37:29 -04:00
Bruce Momjian
878b74e094
In pg_upgrade, remove unnecessary local variable.
2011-10-01 10:01:43 -04:00
Bruce Momjian
5e5958428b
In pg_upgrade, because toast table names can be mismatched with the heap
...
oid on 8.4, modify the toast name comparison test to only apply to old
9.0+ servers. (The test was previously 8.4+.)
Backpatch to 9.1.X.
2011-09-28 22:30:44 -04:00
Peter Eisentraut
52ce20589a
Add missing format attributes
...
Add __attribute__ decorations for printf format checking to the places that
were missing them. Fix the resulting warnings. Add
-Wmissing-format-attribute to the standard set of warnings for GCC, so these
don't happen again.
The warning fixes here are relatively harmless. The one serious problem
discovered by this was already committed earlier in
cf15fb5cab
.
2011-09-10 23:12:46 +03:00
Bruce Momjian
3ced32d24e
In pg_upgrade, disallow migration of 8.3 clusters using contrib/ltree
...
because its internal format was changed in 8.4.
Backpatch to 9.0 and 9.1.
Report by depesz, diagnosis by Tom.
2011-09-07 14:43:12 -04:00
Bruce Momjian
6416a82a62
Remove unnecessary #include references, per pgrminclude script.
2011-09-01 10:04:27 -04:00
Tom Lane
731ebb64b7
Fix not-backwards-compatible pg_upgrade test for prepared transactions.
...
There's no reason for this test to use the undocumented pg_prepared_xact()
function, when it can use the stable API pg_prepared_xacts instead.
Fixes breakage against 8.3, as reported by Justin Arnold.
2011-08-30 17:15:00 -04:00
Bruce Momjian
f1312b5ed3
Add postgres.h to *.c files for pg_upgrade, ltree, and btree_gist, and
...
remove from local *.h files.
Per suggestion from Alvaro.
2011-08-26 21:16:24 -04:00
Bruce Momjian
eb013ede59
In pg_upgrade, limit schema name filter to include toast tables. Bug
...
introduced recently when trying to filter out temp tables.
Backpatch to 9.0 and 9.1.
2011-08-26 00:12:32 -04:00
Bruce Momjian
00a7c9014a
In pg_upgrade, don't copy visibility map files from clusters that did not
...
have crash-safe visibility maps to clusters that expect crash-safety.
Request from Robert Haas.
2011-08-19 11:20:30 -04:00
Bruce Momjian
2411fbdac4
In pg_upgrade, avoid dumping orphaned temporary tables. This makes the
...
pg_upgrade schema matching pattern match pg_dump/pg_dumpall.
Fix for 9.0, 9.1, and 9.2.
2011-08-15 22:40:14 -04:00
Bruce Momjian
a31dc392d6
Fix pg_update to properly test for the data directory's existence on
...
Win32.
Backpatch to 9.1.
2011-07-30 01:50:55 -04:00
Bruce Momjian
081a5518c0
In pg_upgrade on Windows, check if the directory is writable by actually
...
creating and removing a file because access() doesn't work on that
platform.
Backpatch to 9.1 where this check was added.
2011-07-24 01:43:57 -04:00
Bruce Momjian
43aa40e155
In pg_upgrade, add C comment about why we don't try to do shared file
...
writes for logging.
2011-07-21 17:13:17 -04:00
Bruce Momjian
17a16eeb7c
In pg_upgrade, fix the -l/log option to work on Windows.
...
Also, double-quote the log file name in all places, to allow (on all
platforms) log file names with spaces.
Back patch to 9.0 and 9.1.
2011-07-20 18:31:03 -04:00
Bruce Momjian
6b43fddee4
In pg_upgrade, use pg_strudup(), for consistency.
2011-07-20 16:37:17 -04:00
Peter Eisentraut
912bc4f038
Make pg_upgrade output more consistent with project style
...
Add errno-based output to error messages where appropriate, reformat
blocks to about 72 characters per line, use spaces instead of tabs for
indentation, and other style adjustments.
2011-07-12 07:13:51 +03:00
Peter Eisentraut
d7fb49314d
Fix use of unportable %m format
2011-07-07 22:48:59 +03:00
Peter Eisentraut
76dfcb942f
Postgres -> PostgreSQL in error message
2011-07-05 22:41:14 +03:00
Bruce Momjian
a88f4496b7
Change pg_upgrade to use port 50432 by default to avoid unintended
...
client connections during the upgrade. Also rename data/bin/port
environment variables to being with 'PG'. Also no longer honor PGPORT.
2011-07-01 18:17:12 -04:00
Bruce Momjian
0b44818ead
In pg_upgrade, check that the binary and data directories are the same
...
major version.
Backpatch to 9.1.
Dan McGee
2011-06-22 20:48:34 -04:00
Bruce Momjian
3b3c2cf180
In pg_upgrade, fix odd function parameter wrapping.
2011-06-22 19:30:46 -04:00
Bruce Momjian
effbe6ecb4
Rename pg_upgrade directory validation function, for clarity.
2011-06-22 17:50:40 -04:00
Bruce Momjian
559b114dd4
Adjust pg_upgrade check for pg_upgrade_support to happen after the
...
binary directory has been validated.
Backpatch to 9.1.
Dan McGee
2011-06-22 17:47:23 -04:00
Bruce Momjian
b06ad7def8
Fix pg_upgrade status message capitalization mistake.
...
Backpatch to 9.1 and 9.0.
Dan McGee
2011-06-22 14:49:54 -04:00
Bruce Momjian
e3df3572f6
In pg_upgrade, clean up code layout in validateDirectoryOption().
2011-06-15 17:23:02 -04:00
Bruce Momjian
07d17a73ec
In pg_upgrade, check there are no prepared transactions.
2011-06-14 14:53:35 -04:00
Bruce Momjian
6560407c7d
Pgindent run before 9.1 beta2.
2011-06-09 14:32:50 -04:00
Bruce Momjian
11c08c3fd7
In pg_upgrade, do case-insensitive checks of locale, encoding, and ctype
...
because these are often inconsistently capitalized.
2011-05-24 15:59:34 -04:00
Bruce Momjian
1f35944607
In pg_upgrade, clean up handling of invalid directory specification by
...
checking the stat() errno value more strictly.
2011-05-18 22:22:40 -04:00
Bruce Momjian
772a5f1e5b
Improve pg_upgrade error reporting if the bin or data directories do not
...
exist or are not directories.
2011-05-18 18:37:25 -04:00
Peter Eisentraut
0ee391b77a
/contrib/foo -> contrib/foo
...
Since contrib is a relative directory specification, a leading slash
is inappropriate.
2011-05-19 00:30:31 +03:00
Bruce Momjian
92ff915018
Improve pg_upgrade X_OK comment.
2011-05-18 12:25:34 -04:00
Bruce Momjian
6fbf4e0e7c
Fix pg_upgrade build problem on Windows when using X_OK access
...
permission check on the current directory.
2011-05-18 12:13:37 -04:00
Bruce Momjian
e728701fb4
Update pg_upgrade directory check error message.
2011-05-16 12:32:36 -04:00
Bruce Momjian
bda27e502f
Add pg_upgrade check to make sure the user has full access permission in
...
the current directory; if not, throw an error.
2011-05-16 11:01:29 -04:00
Bruce Momjian
6c19bd96bc
Allow pg_upgrade to honor libpq environment variables. Add 'local'
...
checks for PGHOST and PGHOSTADDR.
2011-05-16 10:48:40 -04:00
Peter Eisentraut
00fad9f6fe
Format pg_upgrade --version in line with conventions
2011-05-10 21:40:29 +03:00
Peter Eisentraut
4c78846cb3
Add bug report line to pg_upgrade --help output
2011-05-10 21:37:55 +03:00
Bruce Momjian
5059cf6ebf
In pg_upgrade, remove suggestion of setting pg_hba.conf to 'trust', now
...
that we report the libpq connection failure string. Per suggestion from
Robert Haas.
2011-05-10 10:42:43 -04:00
Bruce Momjian
78318d63d7
In pg_upgrade, add status message about superuser check.
2011-05-09 08:55:36 -04:00
Bruce Momjian
e6a7402842
Add C comment why client encoding can be set in pg_upgrade.
2011-05-07 22:30:35 -04:00
Bruce Momjian
1609ca5adb
In pg_upgrade, report non-super-user username in error message.
2011-05-07 12:17:21 -04:00
Bruce Momjian
81301b8578
Check that the pg_upgrade user specified is a super-user.
...
Also report the error message when the post-pg_ctl connection fails.
Per private bug report from EnterpriseDB.
2011-05-07 08:55:45 -04:00
Bruce Momjian
5c5f83507c
Adjust pg_upgrade FATAL error messages to have consistent newlines.
...
Also adjust some error message capitalization for consistency.
2011-05-06 21:47:42 -04:00
Peter Eisentraut
d6d823c8b0
Improve formatting of pg_upgrade --help output
2011-05-05 23:19:13 +03:00
Bruce Momjian
6c4d2bd914
Now that pg_upgrade uses -w in pg_ctl, remove loop that retried testing
...
the connection; also restructure the libpq connection code.
This patch also removes the unused variable postmasterPID and fixes a
libpq structure leak that was in the testing loop.
2011-04-26 10:15:18 -04:00
Bruce Momjian
44091442db
In pg_upgrade, avoid one start/stop of the postmaster; use the -w
...
(wait) flag for pg_ctl start/stop; remove the unused "quiet" flag in
the functions for starting/stopping the postmaster.
2011-04-25 20:18:23 -04:00
Bruce Momjian
76dd09bbec
Add postmaster/postgres undocumented -b option for binary upgrades.
...
This option turns off autovacuum, prevents non-super-user connections,
and enables oid setting hooks in the backend. The code continues to use
the old autoavacuum disable settings for servers with earlier catalog
versions.
This includes a catalog version bump to identify servers that support
the -b option.
2011-04-25 12:00:21 -04:00
Bruce Momjian
f6322b3191
In pg_upgrade, only compile copy_file() on non-Win32 systems.
...
Per report from Andrew Dunstan.
2011-04-23 20:28:29 -04:00
Bruce Momjian
0262251c33
Pg_upgrade C comment addition.
...
Document why we do the missing new database check during the check
phase.
2011-04-20 05:45:31 -04:00
Bruce Momjian
7228d02989
Throw error for mismatched pg_upgrade clusters
...
If someone removes the 'postgres' database from the old cluster and the
new cluster has a 'postgres' database, the number of databases will not
match. We actually could upgrade such a setup, but it would violate the
1-to-1 mapping of database counts, so we throw an error instead.
Previously they got an error during the upgrade, and not at the check
stage; PG 9.0.4 does the same.
2011-04-19 21:00:29 -04:00
Bruce Momjian
0341944706
Add C comment
...
Add C comment about why we throw an error if the pg_upgrade old/new
database counts don't match.
2011-04-19 19:15:13 -04:00
Bruce Momjian
bf50caf105
pgindent run before PG 9.1 beta 1.
2011-04-10 11:42:00 -04:00
Peter Eisentraut
1eb2231fc4
Allow pg_upgrade with PGCLIENTENCODING set
...
This used to work, but since PGCLIENTENCODING is now a connection
option variable, pg_upgrade would prevent it.
2011-04-07 19:24:47 +03:00
Bruce Momjian
e69d32158c
Simplify structure of query used to gather database object information
...
in pg_upgrade.
2011-04-07 06:23:12 -04:00
Peter Eisentraut
c75163842c
Replace the confusing exit_nicely() by an atexit/on_exit hook
2011-04-06 23:00:44 +03:00
Bruce Momjian
da3418cea9
Mention pg_upgrade sets autovacuum_freeze_max_age to maximum.
2011-03-30 17:45:54 -04:00
Bruce Momjian
d609b08ead
Expand comment on how pg_upgrade is turning off autovacuum.
2011-03-30 17:37:00 -04:00
Bruce Momjian
d67b0bf471
In pg_upgrade, add C comment about how autovacuum is disabled.
2011-03-29 11:11:45 -04:00
Bruce Momjian
898a14e1a0
Remove unused copy_dir() function from pg_upgrade.
2011-03-15 20:52:35 -04:00
Bruce Momjian
d367d41d66
Fix file descriptor leaks in pg_upgrade in failure code paths.
2011-03-08 21:36:17 -05:00
Bruce Momjian
05d93c38a7
Tighten pg_upgrade check for pre-8.4 toast table name matching.
2011-03-06 21:57:37 -05:00
Tom Lane
dfe18f18d2
Fix a couple more missing "static" markers.
2011-03-06 20:14:01 -05:00
Bruce Momjian
a54ba23c08
Improve pg_upgrade relation name check logic for pre-8.4 servers.
2011-03-06 06:34:58 -05:00
Bruce Momjian
8f87dcd863
Update new pg_upgrade comment about pre-8.4 TOAST tables.
2011-03-05 22:09:35 -05:00
Bruce Momjian
9e5bed2df1
Restructure pg_upgrade checks because pre-8.4 Postgres did not rename
...
toast file names to match the new relfilenode.
2011-03-05 21:12:21 -05:00
Bruce Momjian
f7b70dfc76
Fix pg_upgrade to print the proper database name for file transfer
...
failures.
2011-03-05 20:18:31 -05:00
Bruce Momjian
a3375becfa
Print clearer failure message when pg_upgrade fails due to a fatal
...
error.
2011-03-05 19:32:53 -05:00
Bruce Momjian
497e65f822
In pg_upgrade, no need to initialize global struct values; they are
...
always zeros. Also no need to free memory before we exit.
2011-02-16 15:17:28 -05:00
Alvaro Herrera
b4a7e5980b
Cleanup ClusterInfo initialization in pg_upgrade
2011-02-16 14:06:17 -03:00
Bruce Momjian
1cc19cc358
Fix bug in 9.1 pg_upgrade processing of old/new relations; adjust debug
...
output.
2011-02-15 19:01:33 -05:00
Alvaro Herrera
8b2557553c
Make pg_upgrade compile again
2011-02-15 19:52:32 -03:00
Bruce Momjian
fe8f15d5d2
Adjust pg_upgrade error message, array freeing, and add error check.
2011-02-15 15:00:47 -05:00
Tom Lane
629b3af27d
Convert contrib modules to use the extension facility.
...
This isn't fully tested as yet, in particular I'm not sure that the
"foo--unpackaged--1.0.sql" scripts are OK. But it's time to get some
buildfarm cycles on it.
sepgsql is not converted to an extension, mainly because it seems to
require a very nonstandard installation process.
Dimitri Fontaine and Tom Lane
2011-02-13 22:54:49 -05:00
Tom Lane
caddcb8f4b
Fix pg_upgrade to handle extensions.
...
This follows my proposal of yesterday, namely that we try to recreate the
previous state of the extension exactly, instead of allowing CREATE
EXTENSION to run a SQL script that might create some entirely-incompatible
on-disk state. In --binary-upgrade mode, pg_dump won't issue CREATE
EXTENSION at all, but instead uses a kluge function provided by
pg_upgrade_support to recreate the pg_extension row (and extension-level
pg_depend entries) without creating any member objects. The member objects
are then restored in the same way as if they weren't members, in particular
using pg_upgrade's normal hacks to preserve OIDs that need to be preserved.
Then, for each member object, ALTER EXTENSION ADD is issued to recreate the
pg_depend entry that marks it as an extension member.
In passing, fix breakage in pg_upgrade's enum-type support: somebody didn't
fix it when the noise word VALUE got added to ALTER TYPE ADD. Also,
rationalize parsetree representation of COMMENT ON DOMAIN and fix
get_object_address() to allow OBJECT_DOMAIN.
2011-02-09 19:18:08 -05:00
Tom Lane
cd7d748d51
Repair multiple breakage in Windows-specific code for appending '.exe'.
2011-02-02 20:26:43 -05:00
Bruce Momjian
2b6e2dee78
Fix wrong verb in pg_upgrade text message, per Haas.
2011-02-02 16:53:12 -05:00
Bruce Momjian
9d220fc17e
Simplify pg_upgrade checking of executable permissions.
2011-02-02 15:40:52 -05:00
Bruce Momjian
2bb87a61a8
Add pg_upgrade comment for why we can't use template1 inheritance for
...
the support functions.
2011-02-01 12:23:08 -05:00
Bruce Momjian
6238473adb
Fix pg_upgrade to create pg_authid restore functions in the 'postgres'
...
database, not in the os-user database, per report from Magnus.
2011-01-31 20:16:15 -05:00
Bruce Momjian
0a5f119931
A toast relid field are no longer needed in pg_upgrade's rel arrays, so
...
remove them. Also other renaming.
2011-01-10 11:46:02 -05:00
Bruce Momjian
002c105a07
In pg_upgrade, remove functions that did sequential array scans looking
...
up relations, but rather order old/new relations and use the same array
index value for both. This should speed up pg_upgrade for databases
with many relations.
2011-01-08 13:44:44 -05:00
Bruce Momjian
ebaf648ad2
In pg_upgrade, clarify use of install_db_support_functions().
2011-01-08 09:11:48 -05:00
Bruce Momjian
a60b32b3dc
In pg_upgrade, remove unnecessary separate handling of toast tables now
...
that we restore by oid; they can be handled like regular tables when
creating the file mapping structure.
2011-01-08 08:01:52 -05:00
Bruce Momjian
133641a48e
Document why pg_upgrade preserves pg_auth.oid (because they are stored
...
in pg_largeobject_metadata).
2011-01-07 23:02:03 -05:00
Bruce Momjian
2f657e4d72
More pg_upgrade relfilenode C comments added.
2011-01-07 22:57:30 -05:00
Bruce Momjian
3095643d37
Simplify pg_upgrade C comment about what is preserved.
2011-01-07 22:46:41 -05:00
Bruce Momjian
f75383e6e8
In pg_upgrade, track only one copy of namespace/relname in FileNameMap
...
because the old and new values are identical.
2011-01-07 22:36:51 -05:00
Bruce Momjian
519c008a96
Fix C indenting in pg_upgrade function.
2011-01-07 22:01:44 -05:00
Bruce Momjian
d8d3d2a4f3
Fix pg_upgrade of large object permissions by preserving pg_auth.oid,
...
which is stored in pg_largeobject_metadata.
No backpatch to 9.0 because you can't migrate from 9.0 to 9.0 with the
same catversion (because of tablespace conflict), and a pre-9.0
migration to 9.0 has not large object permissions to migrate.
2011-01-07 21:59:29 -05:00
Bruce Momjian
2896c87ce4
Force pg_upgrade's to preserve pg_class.oid, not pg_class.relfilenode.
...
Toast tables have identical pg_class.oid and pg_class.relfilenode, but
for clarity it is good to preserve the pg_class.oid.
Update comments regarding what is preserved, and do some
variable/function renaming for clarity.
2011-01-07 21:26:13 -05:00
Bruce Momjian
46d28820b6
Improve C comments about backend variables set by pg_upgrade_support
...
functions.
2011-01-06 22:45:36 -05:00
Bruce Momjian
56a9adcb96
Rename pg_upgrade variables, for clarity.
2011-01-05 20:14:59 -05:00
Bruce Momjian
e66e43988a
Update pg_upgrade C comments.
2011-01-05 14:09:01 -05:00
Bruce Momjian
a45beaac64
Fix for recent pg_upgrade commit to fix large objects relfilenode
...
handling. (metadata user ids still an open issue).
2011-01-05 13:52:44 -05:00
Bruce Momjian
b1f2a94fa2
In pg_upgrade, adjust transfer_relfile()'s parameters to be more logical.
2011-01-05 12:07:45 -05:00
Bruce Momjian
5cff5b5779
Clarify pg_upgrade's creation of the map file structure. Also clean
...
up pg_dump's calling of pg_upgrade_support functions.
2011-01-05 11:37:08 -05:00
Bruce Momjian
3302334b48
In pg_upgrade, copy pg_largeobject_metadata and its index for 9.0+
...
servers because, like pg_largeobject, it is a system table whose
contents are not dumped by pg_dump --schema-only.
2011-01-04 23:35:49 -05:00
Bruce Momjian
0857a84498
In pg_upgrade, fix backward logging display of link operations.
2011-01-04 21:33:36 -05:00
Bruce Momjian
25cc7424e3
Simplify functions and parameters used by pg_upgrade.
2011-01-04 19:11:37 -05:00
Bruce Momjian
5d950e3b0c
Stamp copyrights for year 2011.
2011-01-01 13:18:15 -05:00
Bruce Momjian
67c9e4442f
Furter pg_upgrade optimizations to reduce function call argument count.
2011-01-01 12:28:48 -05:00
Bruce Momjian
6e6bee987f
In pg_upgrade, remove use of whichCluster, and just pass old/new cluster
...
pointers, which simplifies the code. This was not possible in 9.0 because
everything was in a single nested struct, but is possible now.
Per suggestion from Tom.
2011-01-01 12:06:36 -05:00
Bruce Momjian
f82b3e58f8
In pg_upgrade, rename "CLUSTERNAME" to "CLUSTER_NAME".
2010-12-31 20:42:29 -05:00
Tom Lane
88c803457a
Improve pg_upgrade's checks for required executables.
...
Don't insist on pg_dumpall and psql being present in the old cluster,
since they are not needed. Do insist on pg_resetxlog being present
(in both old and new), since we need it. Also check for pg_config,
but only in the new cluster. Remove the useless attempt to call
pg_config in the old cluster; we don't need to know the old value of
--pkglibdir. (In the case of a stripped-down migration installation
there might be nothing there to look at anyway, so any future change
that might reintroduce that need would have to be considered carefully.)
Per my attempts to build a minimal previous-version installation to support
pg_upgrade.
2010-12-29 13:43:53 -05:00
Bruce Momjian
16b5e08dec
Use "upgrade" in preference over "migrate" in pg_upgrade messages and
...
documentation. (Many were left over from the old pg_migrator naming.)
2010-12-15 07:11:31 -05:00
Tom Lane
3864afa1d1
Clean up some copied-and-pasted code in pg_upgrade.
...
1. Don't reimplement S_ISDIR() and S_ISREG() badly.
2. Don't reimplement access() badly.
This code appears to have been copied from ancient versions of the
corresponding backend routines, and not patched to incorporate subsequent
fixes (see my commits of 2008-03-31 and 2010-01-14 respectively).
It might be a good idea to change it to just *call* those routines,
but for now I'll just transpose these fixes over.
2010-12-11 14:17:46 -05:00
Peter Eisentraut
fc946c39ae
Remove useless whitespace at end of lines
2010-11-23 22:34:55 +02:00
Robert Haas
5aa446c961
Cleanup various comparisons with the constant "true".
...
Itagaki Takahiro, with slight modifications.
2010-11-14 21:03:48 -05:00
Robert Haas
11e482c350
Move copydir() prototype into its own header file.
...
Having this in src/include/port.h makes no sense, now that copydir.c lives
in src/backend/strorage rather than src/port. Along the way, remove an
obsolete comment from contrib/pg_upgrade that makes reference to the old
location.
2010-11-12 16:39:53 -05:00
Tom Lane
71baff1786
Fix buffer overrun in pg_upgrade.
...
Problem reported, and cause identified, by Hernan Gonzalez.
2010-11-02 17:31:41 -04:00
Tom Lane
84c123be1d
Allow new values to be added to an existing enum type.
...
After much expenditure of effort, we've got this to the point where the
performance penalty is pretty minimal in typical cases.
Andrew Dunstan, reviewed by Brendan Jurd, Dean Rasheed, and Tom Lane
2010-10-24 23:05:41 -04:00
Bruce Momjian
a52aa6c6db
Clean up pg_upgrade cache lookup code; remove useless NULL pointer tests.
2010-10-20 20:02:37 +00:00
Bruce Momjian
691a67b922
Rename pg_upgrade 'log' to 'log_opts', to avoid platform naming conflict.
2010-10-20 02:31:17 +00:00
Bruce Momjian
3325c9bddb
Further speed up pg_upgrade lookups.
2010-10-20 02:06:06 +00:00
Bruce Momjian
1c72614be7
Fix for new pg_upgrade cache code.
2010-10-20 01:24:31 +00:00
Bruce Momjian
333b4a45f1
Cache most recent relfilenode lookups, for speed, after report of
...
pg_upgrade slowness for 150k tables.
2010-10-20 00:55:16 +00:00
Bruce Momjian
ad06db2610
In pg_upgrade, use cached copy of directory listing, rather than calling
...
scandir() with a pattern for every table.
Optimization after report of pg_upgrade slowness with 150k tables.
2010-10-20 00:33:19 +00:00
Bruce Momjian
07456b45e6
Pgindent run on pg_upgrade source after restructuring.
2010-10-19 22:37:04 +00:00
Bruce Momjian
e13f7e9a71
Restructure the pg_upgrade code to use several global structures rather
...
than packing everything into 'ctx' and passing that to every function.
2010-10-19 21:38:34 +00:00
Bruce Momjian
722d5beeb2
In pg_upgrade, rename SHELL_EXT to SCRIPT_EXT, for clarity.
2010-10-19 15:57:55 +00:00
Bruce Momjian
51eeccd6cc
Add removal of PG_VERSION to optional old cluster deletion script.
...
Backpatch to 9.0.X.
2010-10-19 15:52:43 +00:00
Bruce Momjian
9df96f9bb1
In pg_upgrade, rename macro EXEC_EXT to SHELL_EXT for clarity.
...
Backpatch to 9.0.X.
2010-10-19 02:56:16 +00:00
Bruce Momjian
fe61db6f0c
Have pg_upgrade use strtoul(), not strtol().
2010-09-29 02:40:25 +00:00
Bruce Momjian
807005c024
Use macro atooid() for conversion of strings to oids, per suggestion
...
from Tom.
2010-09-28 22:11:39 +00:00
Bruce Momjian
9340fb80b1
In pg_upgrade, properly handle oids > 2^31 by using strtoul() internally
...
rather than atol().
Per report from Brian Hirt
2010-09-28 21:41:03 +00:00
Bruce Momjian
a1bb570de9
Fix leak patch that was using fclose() instead of close().
2010-09-28 21:27:32 +00:00
Bruce Momjian
f175884520
Properly close files after read file failure to prevent potential
...
resource leak. Of course, any such failure aborts pg_upgrade, but might
as well be clean about it.
Per patch from Grzegorz Ja?kiewicz.
2010-09-28 19:28:34 +00:00
Magnus Hagander
fe9b36fd59
Convert cvsignore to gitignore, and add .gitignore for build targets.
2010-09-22 12:57:04 +02:00
Magnus Hagander
9f2e211386
Remove cvs keywords from all files.
2010-09-20 22:08:53 +02:00
Bruce Momjian
c5d94a34fb
Modify pg_upgrade to set/restore all environment variables related to
...
collation/encoding to match English when reading controldata. This now
matches the English variable setting used by pg_regress.c.
Backpatch to 9.0.X.
2010-09-07 14:10:30 +00:00
Peter Eisentraut
3f11971916
Remove extra newlines at end and beginning of files, add missing newlines
...
at end of files.
2010-08-19 05:57:36 +00:00
Bruce Momjian
8af787ea24
Adjust check_for_isn_and_int8_passing_mismatch() so it is called for all
...
migrations.
Backpatch to 9.0.
2010-07-25 03:47:29 +00:00
Bruce Momjian
f31b1fd7c1
Prevent pg_upgrade from migrating databases that use reg* data types
...
where the oid is not preserved by pg_upgrade (everything but pg_type).
Update documentation.
Per bug report from depstein@alliedtesting.com .
2010-07-25 03:28:32 +00:00
Bruce Momjian
4504a1bc01
On Win32, pg_upgrade cannot sent any server log output to the log file
...
because of file access limitations on that platform.
2010-07-13 20:03:32 +00:00
Bruce Momjian
477c01b00d
Remove incorrect email address for pg_upgrade bug reports.
2010-07-13 18:14:14 +00:00
Bruce Momjian
f87bd25f00
In pg_upgrade, report /bin directory checks independent of /data checks.
2010-07-13 18:09:55 +00:00
Bruce Momjian
804f96accb
In pg_upgrade, prevent psql AUTOCOMMIT=off by not loading .psqlrc.
2010-07-13 15:56:53 +00:00
Bruce Momjian
a0d7c5f689
Properly report errno/out-of-disk-space error from pg_upgrade when in
...
copy mode, per report from depstein@alliedtesting.com .
Patch suggestion from Magnus.
Backpatch to 9.0.X.
2010-07-09 16:51:23 +00:00
Bruce Momjian
239d769e7e
pgindent run for 9.0, second run
2010-07-06 19:19:02 +00:00
Bruce Momjian
da254e3d16
Make pg_upgrade copyrights just 2010, not 2010-2010.
2010-07-03 16:33:15 +00:00
Bruce Momjian
de255a6eb1
Add copyrights to pg_upgrade and pg_upgrade_tools files, per Tom.
2010-07-03 16:25:01 +00:00
Bruce Momjian
ccbe0c14e6
Add CVS tags to pg_upgrade and pg_upgrade_support files, per request
...
from Tom.
2010-07-03 14:23:14 +00:00
Tom Lane
600fc1dc9d
Get rid of some more stuff that duplicates c.h or port.h.
2010-07-01 15:52:52 +00:00
Bruce Momjian
14bd1c3d9e
Remove port.h prototypes from pg_upgrade.h, per report from Robert Haas.
2010-07-01 14:37:53 +00:00
Bruce Momjian
c1b617987d
Add username designations to all pg_upgrade utility calls that support it.
2010-06-23 20:04:50 +00:00
Bruce Momjian
601d1eeddc
Fix pg_upgrade's use of pg_ctl on Win32 to not send command and sever
...
output to the same file, because it is impossible.
Also set user name for pg_dumpall in pg_upgrade.
2010-06-22 16:45:10 +00:00
Bruce Momjian
1aa117506d
Fix pg_upgrade to remove malloc(0) call.
2010-06-16 19:43:11 +00:00
Bruce Momjian
24cb6ab9af
Fix storage of getopt() return, should be 'int', for pg_upgrade.
...
Steve Singer
2010-06-15 23:25:01 +00:00
Bruce Momjian
8141523e35
Properly define pg_upgrade global variable, per bug report from Chris
...
Ruprecht on Mac (64 bit).
2010-06-15 02:08:01 +00:00
Bruce Momjian
785c2acc12
Update pg_upgrade C comment about cwd.
2010-06-12 17:45:28 +00:00
Bruce Momjian
1dc7c796c9
Have pg_upgrade create its output files in the current directory, rather
...
than in a subdirectory of the $HOME directory, or $TMP in Windows.
2010-06-12 17:05:29 +00:00
Bruce Momjian
9b6dba1193
Remove IMPLEMENTATION.jp file from pg_upgrade docs; still in pgFoundry
...
for pg_migrator, per suggestion from Magnus.
2010-05-25 16:53:24 +00:00
Bruce Momjian
02265f06b7
Update pg_upgrade IMPLEMENTATION doc file to match current 9.0 behavior.
2010-05-25 16:09:29 +00:00
Bruce Momjian
238d21d7d2
Modify pg_standby, pgbench, and pg_upgrade manual pages to be consistent
...
in their display of command-line options with other client applications.
2010-05-25 15:55:28 +00:00
Bruce Momjian
f4e9436026
Add Japanese Implementation file to CVS.
2010-05-25 02:56:36 +00:00
Bruce Momjian
7a74d70e71
Re-order pg_upgrade 'help' options to be alphabetical.
2010-05-25 02:55:58 +00:00
Bruce Momjian
6368682788
In pg_upgrade, test for datallowconn instead of hardcoding template0.
2010-05-24 19:52:33 +00:00
Bruce Momjian
00be75415c
Split apart pg_upgrade user lookup and root check so '--help' shows
...
proper default username.
2010-05-24 16:34:35 +00:00
Tom Lane
add8044778
issue_warnings() has no business freeing its parameter, especially not when
...
its sole caller does that too. Jan Matousek, via Pavel Stehule
2010-05-23 16:54:13 +00:00
Bruce Momjian
3245bd5240
Simplify pg_upgrade queries by using IN instead of multiple OR clauses
...
comparing the same column to multiple values.
2010-05-19 18:56:47 +00:00
Bruce Momjian
573e446f6f
For pg_upgrade, update template0's datfrozenxid and its relfrozenxids to
...
match the behavior of autovacuum, which does this as the xid advances
even if autovacuum is turned off.
2010-05-19 18:27:43 +00:00
Bruce Momjian
64719a18db
Use a 'datallowconn' check for avoiding 'template0', rather than
...
hardcoding a 'template0' check, per suggestion from Alvaro.
This might fix a problem where someone has allowed 'template0'
connections, but it is a cleaner approach even if doesn't fix the
bug.
2010-05-18 18:40:51 +00:00
Bruce Momjian
37953b2d20
Add pg_upgrade TESTING files explaining a testing method.
2010-05-18 03:26:12 +00:00
Bruce Momjian
5c337fb45c
Adjust pg_upgrade BSD defines for scandir(), per report from Giles Lean
2010-05-15 10:21:54 +00:00
Bruce Momjian
5781d96dc3
Change bsdi define to __bsdi__
2010-05-15 10:08:28 +00:00
Tom Lane
88fba7089e
Fix another obvious bug pointed out by a compiler warning.
2010-05-14 00:43:42 +00:00
Tom Lane
0546906064
Remove another unsafe use of random data as a format string.
2010-05-14 00:39:51 +00:00
Tom Lane
8eac39780d
Get rid of unsafe sprintf and snprintf usages. Per compiler warnings.
2010-05-14 00:32:21 +00:00
Tom Lane
adf6b8edfb
Spell __darwin__ correctly, to suppress compiler warning on OSX.
2010-05-14 00:19:46 +00:00
Bruce Momjian
e9ad14f9f4
Use NAMEDATALEN instead of local define.
...
Modify path separators for Win32.
Per ideas from Takahiro Itagaki
2010-05-14 00:13:38 +00:00
Bruce Momjian
36d3afd2d4
Remove all mentions of EnterpriseDB Advanced Server from pg_upgrade;
...
EDB must maintain their own patch set for this.
2010-05-13 22:51:00 +00:00
Tom Lane
382ff21203
Fix up lame idea of not using autoconf to determine if platform has scandir().
...
Should fix buildfarm failures.
2010-05-13 22:07:43 +00:00
Magnus Hagander
2b61b3e507
Assorted fixes to make pg_upgrade build on MSVC.
...
* There is no chmod() on Windows.
* Must always use the 3-parameter version of open()
* There is no dynloader.h - but it also appears unnecessary on all platforms
* Don't include shlobj.h because it causes compile errors, and from what I can
see it's not actually used. This may need to be added back for mingw
and/or cygwin in the worst case.
2010-05-13 15:58:15 +00:00
Bruce Momjian
9885206cab
Move pg_upgrade shared library out into its own /contrib directory
...
(pg_upgrade_support).
2010-05-13 01:03:01 +00:00
Tom Lane
c9c25a982c
Clean up unnecessary unportability and compiler warnings by removing the
...
cmp parameter for pg_scandir(). The code failed to support this anyway
for Sun/Windows, so pretending we could accept a parameter other than
NULL was just asking for trouble.
2010-05-12 16:50:00 +00:00
Bruce Momjian
b460b5cd11
Move pg_upgrade TODO to TODO wiki.
2010-05-12 13:59:21 +00:00
Bruce Momjian
395d1259ad
Add PGFILEDESC description to Makefiles for all /contrib executables.
...
Add PGAPPICON to all executable makefiles.
2010-05-12 11:33:10 +00:00
Bruce Momjian
561afa534d
Small formatting adjustment.
2010-05-12 11:07:24 +00:00
Bruce Momjian
a898199df5
Add pg_upgrade IMPLEMENTATION file to CVS.
2010-05-12 02:24:43 +00:00
Bruce Momjian
6c4a98d99c
Add TODO file to CVS.
2010-05-12 02:23:56 +00:00
Bruce Momjian
c2e9b2f288
Add pg_upgrade to /contrib; will be in 9.0 beta2.
...
Add documentation.
Supports migration from PG 8.3 and 8.4.
2010-05-12 02:19:11 +00:00