Commit Graph

1946 Commits

Author SHA1 Message Date
Peter Eisentraut b24181b26f Improve pg_archivecleanup and pg_standby --help output
For consistency with other tools, put the options before further usage
information.

In pg_standby, remove the supposedly deprecated -l option from the
given example invocation.
2011-05-05 23:19:13 +03: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
Peter Eisentraut f8ebe3bcc5 Support "make check" in contrib
Added a new option --extra-install to pg_regress to arrange installing
the respective contrib directory into the temporary installation.
This is currently not yet supported for Windows MSVC builds.

Updated the .gitignore files for contrib modules to ignore the
leftovers of a temp-install check run.

Changed the exit status of "make check" in a pgxs build (which still
does nothing) to 0 from 1.

Added "make check" in contrib to top-level "make check-world".
2011-04-25 22:27:11 +03: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
Tom Lane bb85030630 Fix contrib/btree_gist to handle collations properly.
Make use of the collation attached to the index column, instead of
hard-wiring DEFAULT_COLLATION_OID.  (Note: in theory this could require
reindexing btree_gist indexes on textual columns, but I rather doubt anyone
has one with a non-default declared collation as yet.)
2011-04-22 20:19:58 -04:00
Tom Lane 474ff212e5 De-kludge contrib/btree_gin for collations.
Using DEFAULT_COLLATION_OID in the comparePartial functions was not only
a lame hack, but outright wrong, because the compare functions for
collation-aware types were already responding to the declared index
collation.  So comparePartial would have the wrong expectation about
the index's sort order, possibly leading to missing matches for prefix
searches.
2011-04-22 18:22:38 -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
Peter Eisentraut 385942f46c Refix the unaccent regression test on MSVC properly
... for some value of "properly".  Instead of overriding REGRESS_OPTS,
set the variables ENCODING and NO_LOCALE, which is more expressive and
allows overriding by the user.  Fix vcregress.pl to handle that.
2011-04-19 22:52:52 +03:00
Peter Eisentraut 001cbb145f Avoid unused variable warnings for certain configurations 2011-04-19 20:01:51 +03:00
Andrew Dunstan b7b86924c6 Attempt to remedy buildfarm breakage caused by commit f536d4194. 2011-04-18 09:27:30 -04:00
Peter Eisentraut f536d41942 Rename pg_regress option --multibyte to --encoding
Also refactor things a little bit so that the same methods for setting
test locale and encoding can be used everywhere.
2011-04-15 08:42:05 +03:00
Tom Lane d64713df7e Pass collations to functions in FunctionCallInfoData, not FmgrInfo.
Since collation is effectively an argument, not a property of the function,
FmgrInfo is really the wrong place for it; and this becomes critical in
cases where a cached FmgrInfo is used for varying purposes that might need
different collation settings.  Fix by passing it in FunctionCallInfoData
instead.  In particular this allows a clean fix for bug #5970 (record_cmp
not working).  This requires touching a bit more code than the original
method, but nobody ever thought that collations would not be an invasive
patch...
2011-04-12 19:19:24 -04:00
Peter Eisentraut 5caa3479c2 Clean up most -Wunused-but-set-variable warnings from gcc 4.6
This warning is new in gcc 4.6 and part of -Wall.  This patch cleans
up most of the noise, but there are some still warnings that are
trickier to remove.
2011-04-11 22:28:45 +03:00
Andrew Dunstan c1d82a936f Remove CRLF line endings in new cube results file. 2011-04-10 18:26:53 -04:00
Andrew Dunstan 210f95f1cd Adjust regression tests on cube and ECPG for MinGW 64 bit compiler.
Backport to 9.0, we're not supporting this compiler on earlier releases.
2011-04-10 16:57:42 -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
Tom Lane 2594cf0e8c Revise the API for GUC variable assign hooks.
The previous functions of assign hooks are now split between check hooks
and assign hooks, where the former can fail but the latter shouldn't.
Aside from being conceptually clearer, this approach exposes the
"canonicalized" form of the variable value to guc.c without having to do
an actual assignment.  And that lets us fix the problem recently noted by
Bernd Helmle that the auto-tune patch for wal_buffers resulted in bogus
log messages about "parameter "wal_buffers" cannot be changed without
restarting the server".  There may be some speed advantage too, because
this design lets hook functions avoid re-parsing variable values when
restoring a previous state after a rollback (they can store a pre-parsed
representation of the value instead).  This patch also resolves a
longstanding annoyance about custom error messages from variable assign
hooks: they should modify, not appear separately from, guc.c's own message
about "invalid parameter value".
2011-04-07 00:12:02 -04:00
Peter Eisentraut c75163842c Replace the confusing exit_nicely() by an atexit/on_exit hook 2011-04-06 23:00:44 +03:00
Robert Haas 595a441ae9 Add missing check on invocation of trusted procedures.
KaiGai Kohei
2011-04-04 13:25:42 -04: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
Alvaro Herrera e5948e3504 Add missing #include 2011-03-28 10:37:29 -03:00
Bruce Momjian 898a14e1a0 Remove unused copy_dir() function from pg_upgrade. 2011-03-15 20:52:35 -04:00
Bruce Momjian 303b7fcd10 Modify pg_test_fsync to match the behavior of git head in regards to
O_DIRECT behavior.
2011-03-10 20:25:41 -05:00
Itagaki Takahiro 2d8de0a50b Cleanup copyright years and file names in the header comments of some files. 2011-03-10 15:05:33 +09: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
Tom Lane 94be9e3f0c Fix citext's upgrade-from-unpackaged script to set its collation correctly.
Although there remains some debate about how CREATE TYPE should represent
the collation property, this doesn't really affect what we need to do in
citext's script, so go ahead and fix that.
2011-03-03 13:22:18 -05:00
Tom Lane 8c4164540b Add -lm to SHLIB_LINK for contrib/btree_gist.
Now that btree_gist contains a reference to isinf(), this is necessary
at least on some platforms.  Per buildfarm.
2011-03-03 01:43:38 -05:00
Tom Lane 8436489c81 Add KNNGIST support to contrib/btree_gist.
This extends GiST's support for nearest-neighbor searches to many of the
standard data types.

Teodor Sigaev
2011-03-02 14:44:33 -05:00
Tom Lane a874fe7b4c Refactor the executor's API to support data-modifying CTEs better.
The originally committed patch for modifying CTEs didn't interact well
with EXPLAIN, as noted by myself, and also had corner-case problems with
triggers, as noted by Dean Rasheed.  Those problems show it is really not
practical for ExecutorEnd to call any user-defined code; so split the
cleanup duties out into a new function ExecutorFinish, which must be called
between the last ExecutorRun call and ExecutorEnd.  Some Asserts have been
added to these functions to help verify correct usage.

It is no longer necessary for callers of the executor to call
AfterTriggerBeginQuery/AfterTriggerEndQuery for themselves, as this is now
done by ExecutorStart/ExecutorFinish respectively.  If you really need to
suppress that and do it for yourself, pass EXEC_FLAG_SKIP_TRIGGERS to
ExecutorStart.

Also, refactor portal commit processing to allow for the possibility that
PortalDrop will invoke user-defined code.  I think this is not actually
necessary just yet, since the portal-execution-strategy logic forces any
non-pure-SELECT query to be run to completion before we will consider
committing.  But it seems like good future-proofing.
2011-02-27 13:44:12 -05:00
Alvaro Herrera 0056066d06 Update pageinspect--1.0.sql to match the upgrade script
Per comment from Tom
2011-02-25 19:39:02 -03:00
Alvaro Herrera a338d65461 Fix pageinspect's heap_page_item to return infomasks as 32 bit values
HeapTupleHeader's t_infomask and t_infomask2 are defined as 16-bit
unsigned integers, so when the 16th bit was set, heap_page_item was
returning them as negative values, which was ugly.

The change to pageinspect--unpackaged--1.0.sql allows a module upgraded
from 9.0 to be cleanly updated from the previous definition.
2011-02-25 19:04:25 -03:00
Itagaki Takahiro 3cba8240a1 Add ENCODING option to COPY TO/FROM and file_fdw.
File encodings can be specified separately from client encoding.
If not specified, client encoding is used for backward compatibility.

Cases when the encoding doesn't match client encoding are slower
than matched cases because we don't have conversion procs for other
encodings. Performance improvement would be be a future work.

Original patch by Hitoshi Harada, and modified by me.
2011-02-21 14:32:40 +09:00
Tom Lane 087bd179e6 Minor logic fix for new levenshtein implementation.
Alexander Korotkov
2011-02-20 14:55:07 -05:00
Tom Lane 7c5d0ae707 Add contrib/file_fdw foreign-data wrapper for reading files via COPY.
This is both very useful in its own right, and an important test case
for the core FDW support.

This commit includes a small refactoring of copy.c to expose its option
checking code as a separately callable function.  The original patch
submission duplicated hundreds of lines of that code, which seemed pretty
unmaintainable.

Shigeru Hanada, reviewed by Itagaki Takahiro and Tom Lane
2011-02-20 14:06:59 -05:00