Commit Graph

56 Commits

Author SHA1 Message Date
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
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
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
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
Bruce Momjian
bf50caf105 pgindent run before PG 9.1 beta 1. 2011-04-10 11:42:00 -04: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
Bruce Momjian
05d93c38a7 Tighten pg_upgrade check for pre-8.4 toast table name matching. 2011-03-06 21:57:37 -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
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
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
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
2f657e4d72 More pg_upgrade relfilenode C comments added. 2011-01-07 22:57:30 -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
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
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
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
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
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
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
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
Magnus Hagander
9f2e211386 Remove cvs keywords from all files. 2010-09-20 22:08:53 +02: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
Bruce Momjian
6368682788 In pg_upgrade, test for datallowconn instead of hardcoding template0. 2010-05-24 19:52:33 +00:00