Bruce Momjian
fbcfa90bb8
Fix pg_upgrade file share violation on Windows created by the commit
...
4741e9afb9
. This was done by adding an
optional second log file parameter to exec_prog(), and closing and
reopening the log file between system() calls.
Backpatch to 9.2.
2012-08-07 13:10:44 -04:00
Bruce Momjian
e8969c4733
In pg_upgrade, use pg_log() instead of prep_status() for
...
newline-terminated messages, per suggestion from Tom.
Backpatch to 9.2.
2012-08-03 12:43:37 -04:00
Bruce Momjian
4da8fc05f0
Simplify pg_upgrade's handling when returning directory listings.
...
Backpatch to 9.2.
2012-07-26 06:22:22 -04:00
Tom Lane
faf26bf117
Get rid of useless global variable in pg_upgrade.
...
Since the scandir() emulation was taken out of pg_upgrade, there's
no longer any need for scandir_file_pattern to exist as a global
variable. Replace it with a local in the one remaining function
that was making use of it.
2012-07-18 01:23:12 -04:00
Tom Lane
3d6ec663bb
Improve pg_upgrade's load_directory() function.
...
Error out on out-of-memory, rather than returning -1, which the sole
existing caller wasn't checking for anyway. There doesn't seem to be
any use-case for making the caller check for failure here.
Detect failure return from readdir().
Use a less platform-dependent method of calculating the entrysize.
It's possible, but not yet confirmed, that this explains bug #6733 ,
in which Mike Wilson reports a pg_upgrade crash that did not occur
in 9.1. (Note that load_directory is effectively new code in 9.2,
at least on platforms that have scandir().)
Fix up comments, avoid uselessly using two counters, reduce the number
of realloc calls to something sane.
2012-07-18 01:13:20 -04:00
Bruce Momjian
c742d1dbe7
Update pg_upgrade comments for recent configpath fix.
2012-07-06 09:39:22 -04:00
Bruce Momjian
2eeb5eb23f
Fix PGDATAOLD and PGDATANEW to properly set pgconfig location, per
...
report from Tom.
Backpatch to 9.2.
2012-07-05 23:36:43 -04:00
Alvaro Herrera
666d494d19
pg_upgrade: abstract out copying of files from old cluster to new
...
Currently only pg_clog is copied, but some other directories could need
the same treatment as well, so create a subroutine to do it.
Extracted from my (somewhat larger) FOR KEY SHARE patch.
2012-07-05 11:38:42 -04:00
Alvaro Herrera
4741e9afb9
Make the pg_upgrade log files contain actual commands
...
Now the log file not only contains the output from commands executed by
system(), but also what command it was in the first place. This
arrangement makes debugging a lot simpler.
2012-06-29 11:39:11 -04:00
Alvaro Herrera
9e26326ad6
pg_upgrade: fix off-by-one mistake in snprintf
...
snprintf counts trailing NUL towards the char limit. Failing to account
for that was causing an invalid value to be passed to pg_resetxlog -l,
aborting the upgrade process.
2012-06-28 23:37:27 -04:00
Heikki Linnakangas
038f3a0509
Fix pg_upgrade, broken by the xlogid/segno -> 64-bit int refactoring.
...
The xlogid + segno representation of a particular WAL segment doesn't make
much sense in pg_resetxlog anymore, now that we don't use that anywhere
else. Use the WAL filename instead, since that's a convenient way to name a
particular WAL segment.
I did this partially for pg_resetxlog in the original xlogid/segno -> uint64
patch, but I neglected pg_upgrade and the docs. This should now be more
complete.
2012-06-26 07:49:02 +03:00
Peter Eisentraut
bb7520cc26
Make documentation of --help and --version options more consistent
...
Before, some places didn't document the short options (-? and -V),
some documented both, some documented nothing, and they were listed in
various orders. Now this is hopefully more consistent and complete.
2012-06-18 02:46:59 +03:00
Bruce Momjian
877b55c619
Improve pg_upgrade wording for pg_ctl start failure; could be
...
connection failure.
Backpatch to 9.2.
Per report from Evan D. Hoffman
2012-06-15 19:57:01 -04:00
Bruce Momjian
b9212e379c
In pg_upgrade, verify that the install user has the same oid on both
...
clusters, and make sure the new cluster has no additional users.
Backpatch to 9.1.
2012-06-13 12:19:18 -04:00
Bruce Momjian
927d61eeff
Run pgindent on 9.2 source tree in preparation for first 9.3
...
commit-fest.
2012-06-10 15:20:04 -04:00
Bruce Momjian
8fcbfea788
In pg_upgrade, report pre-PG 8.1 plpython helper functions left in the
...
public schema that no longer point to valid shared object libraries, and
suggest a solution.
2012-06-01 11:40:04 -04:00
Bruce Momjian
4498a3407a
Improve pg_upgrade C comment.
2012-05-27 06:45:29 -04:00
Bruce Momjian
20a3830b81
Add C comment explaining why we can't exclude checking functions in the
...
pg_catalog schema, even though they are not explicitly dumped (they are
implicitly dumped, e.g. create language plperl).
2012-05-27 06:35:10 -04:00
Bruce Momjian
d4696fa68f
Add pg_update C comment about problems with plpython_call_handler().
2012-05-27 06:29:45 -04:00
Bruce Momjian
45ca31d6a7
Have pg_upgrade only use one extra log file for Win32, not two.
2012-05-25 09:10:07 -04:00
Bruce Momjian
d226e236c6
On Windows, have pg_upgrade use different two files to log pg_ctl
...
start/stop output, to fix file share error reported by Edmund Horner
2012-05-24 20:30:39 -04:00
Bruce Momjian
476291bef0
Adjust pg_upgrade to output a separate log file for pg_ctl output on
...
Windows, to avoid opening a file by multiple processes.
2012-05-23 20:19:34 -04:00
Peter Eisentraut
c8e086795a
Remove whitespace from end of lines
...
pgindent and perltidy should clean up the rest.
2012-05-15 22:19:41 +03:00
Peter Eisentraut
081ca7a0d1
Tweak contrib --help output to match common style
...
Placeholders such as OPTION are typically kept in singular.
2012-05-08 21:55:05 +03:00
Robert Haas
5d4b60f2f2
Lots of doc corrections.
...
Josh Kupershmidt
2012-04-23 22:43:09 -04:00
Bruce Momjian
38458e4573
Fix pg_upgrade to properly upgrade a table that is stored in the cluster
...
default tablespace, but part of a database that is in a user-defined
tablespace. Caused "file not found" error during upgrade.
Per bug report from Ants Aasma.
Backpatch to 9.1 and 9.0.
2012-04-10 19:57:14 -04:00
Tom Lane
98316e211b
Silence compiler warning about uninitialized variable.
2012-03-27 14:47:23 -04:00
Peter Eisentraut
1b12c3e836
pg_upgrade: Add new generated file to .gitignore
2012-03-20 20:40:31 +02:00
Bruce Momjian
02b183acb4
In pg_upgrade, remove dependency on pg_config, as that might not be in
...
the non-development install. Instead, use the LOAD mechanism to check
for the pg_upgrade_support shared object, like we do for other shared
object checks.
Backpatch to 9.1.
Report from Àlvaro
2012-03-19 09:31:50 -04:00
Bruce Momjian
ced53c38d7
In pg_upgrade, move new echo quote define into include file.
2012-03-17 09:56:56 -04:00
Bruce Momjian
faec2815c8
In pg_upgrade, create a script to incrementally generate more accurate
...
optimizer statistics so the cluster can be made available sooner.
2012-03-16 18:54:23 -04:00
Bruce Momjian
7c8cfed78a
Uppercase pg_upgrade status output title.
2012-03-14 19:22:11 -04:00
Bruce Momjian
717f6d6085
In pg_upgrade, add various logging improvements:
...
add ability to control permissions of created files
have psql echo its queries for easier debugging
output four separate log files, and delete them on success
add -r/--retain option to keep log files after success
make logs file append-only
remove -g/-G/-l logging options
sugggest tailing appropriate log file on failure
enhance -v/--verbose behavior
2012-03-12 19:48:03 -04:00
Bruce Momjian
2127aac6ef
In pg_upgrade, only lock the old cluster if link mode is used, and do it
...
right after we restore the schema (a common failure point), and right
before we do the link operation.
Per suggesgtions from Robert and ^!C^!^@lvaro
2012-03-05 21:20:06 -05:00
Bruce Momjian
4e6092a227
Improve wording of pg_upgrade logfile option:
...
-l, --logfile=FILENAME log internal activity to file\n\
2012-02-22 18:40:32 -05:00
Bruce Momjian
7f951474dc
Have pg_upgrade output 'link' or 'copy' when reporting its status.
...
Idea from Peter.
2012-02-15 14:23:03 -05:00
Bruce Momjian
3946c28161
Fix pg_upgrade --help text for --user to not use a plural cluster name.
2012-01-26 22:18:58 -05:00
Bruce Momjian
6d5aae7afa
Now that the shared library name can be adjusted in the library test,
...
have pg_upgrade allocate a maximum fixed size buffer for testing the
library file name, rather than base the allocation on the library name.
Backpatch to 9.1.
2012-01-25 09:35:17 -05:00
Bruce Momjian
a7f2c79a6e
Improve plpython fix comment in pg_upgrade.
2012-01-24 22:49:55 -05:00
Bruce Momjian
cfe443ab9d
In pg_upgrade, when checking for the plpython library, we must check for
...
"plpython2" when upgrading from pre-PG 9.1. Patch to head and 9.1.
Per report from Peter.
2012-01-24 22:42:37 -05:00
Bruce Momjian
b95aec5290
Fix new SQL tablespace location function usage in pg_upgrade to properly
...
check cluster version numbers, and fix missing table alias.
2012-01-24 21:51:10 -05:00
Bruce Momjian
ecf7a2ea38
Add pg_upgrade C comment about why we check all relkinds for regtypes.
2012-01-19 16:04:34 -05:00
Bruce Momjian
e126958c2e
Update copyright notices for year 2012.
2012-01-01 18:01:58 -05:00
Peter Eisentraut
d383c23f6f
Remove support for on_exit()
...
All supported platforms support the C89 standard function atexit()
(SunOS 4 probably being the last one not to), and supporting both
makes the code clumsy.
2011-12-27 20:57:59 +02:00
Peter Eisentraut
c317a3ac16
Run "make all" as a prerequisite of "make check"
...
This is the standard behavior but was forgotten in some places.
2011-12-27 20:27:24 +02:00
Magnus Hagander
16d8e594ac
Remove spclocation field from pg_tablespace
...
Instead, add a function pg_tablespace_location(oid) used to return
the same information, and do this by reading the symbolic link.
Doing it this way makes it possible to relocate a tablespace when the
database is down by simply changing the symbolic link.
2011-12-07 10:37:33 +01:00
Bruce Momjian
0e8f6bf0e7
In pg_upgrade, allow tables using regclass to be upgraded because we
...
preserve pg_class oids since PG 9.0.
2011-12-05 16:45:19 -05:00
Tom Lane
9c6aa8cca0
Move EXTRA_CLEAN to where it actually works.
2011-11-29 23:14:16 -05:00
Peter Eisentraut
b258ceb3ad
pg_upgrade: Disable installcheck
...
Disabled for now because some build farm members with low resources
are not prepared to handle it.
2011-11-29 06:57:09 +02:00
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