Commit Graph

19709 Commits

Author SHA1 Message Date
Peter Eisentraut 9d182ef002 Update of install-sh, mkinstalldirs, and associated configury
Update install-sh to that from Autoconf 2.63, plus our Darwin-specific
changes (which I simplified a bit).  install-sh is now able to install
multiple files in one run, so we could simplify our makefiles sometime.

install-sh also now has a -d option to create directories, so we don't need
mkinstalldirs anymore.

Use AC_PROG_MKDIR_P in configure.in, so we can use mkdir -p when available
instead of install-sh -d.  For consistency with the rest of the world,
the corresponding make variable has been renamed from $(mkinstalldirs) to
$(MKDIR_P).
2009-08-26 22:24:44 +00:00
Peter Eisentraut 7ca774a873 Add -Wno-error to CFLAGS from gram.o as long as it's broken. 2009-08-26 22:15:59 +00:00
Peter Eisentraut 27c405d61a Enhanced error context support in PL/Python
Extract the "while creating return value" and "while modifying trigger
row" parts of some error messages into another layer of error context.
This will simplify the upcoming patch to improve data type support, but
it can stand on its own.
2009-08-25 12:44:59 +00:00
Peter Eisentraut 983d10833e Use generic attribute management in PL/Python
Switch the implementation of the plan and result types to generic attribute
management, as described at <http://docs.python.org/extending/newtypes.html>.
This modernizes and simplifies the code a bit and prepares for Python 3.1,
where the old way doesn't work anymore.
2009-08-25 08:14:42 +00:00
Peter Eisentraut 5dff93638c Make PL/Python tests more compatible with Python 3
This changes a bunch of incidentially used constructs in the PL/Python
regression tests to equivalent constructs in cases where Python 3 no longer
supports the old syntax.  Support for older Python versions is unchanged.
2009-08-24 20:25:25 +00:00
Tom Lane 8bed238c87 Try to make silent_mode behave somewhat reasonably.
Instead of sending stdout/stderr to /dev/null after forking away from the
terminal, send them to postmaster.log within the data directory.  Since
this opens the door to indefinite logfile bloat, recommend even more
strongly that log output be redirected when using silent_mode.

Move the postmaster's initial calls of load_hba() and load_ident() down
to after we have started the log collector, if we are going to.  This
is so that errors reported by them will appear in the "usual" place.

Reclassify silent_mode as a LOGGING_WHERE, not LOGGING_WHEN, parameter,
since it's got absolutely nothing to do with the latter category.

In passing, fix some obsolete references to -S ... this option hasn't
had that switch letter for a long time.

Back-patch to 8.4, since as of 8.4 load_hba() and load_ident() are more
picky (and thus more likely to fail) than they used to be.  This entire
change was driven by a complaint about those errors disappearing into
the bit bucket.
2009-08-24 20:08:32 +00:00
Tom Lane 5a4f763841 Small correction to previous patch: we shouldn't ReleasePostmasterChildSlot
for a dead_end child, because we didn't AssignPostmasterChildSlot.
2009-08-24 18:09:37 +00:00
Alvaro Herrera 45f9b4646f Avoid calling kill() in a postmaster signal handler.
This causes problems when the system load is high, per report from Zdenek
Kotala in <1250860954.1239.114.camel@localhost>; instead of calling kill
directly, have the signal handler set a flag which is checked in ServerLoop.
This way, the handler can return before being called again by a subsequent
signal sent from the autovacuum launcher.  Also, increase the sleep in the
launcher in this failure path to 1 second.

Backpatch to 8.3, which is when the signalling between autovacuum
launcher/postmaster was introduced.

Also, add a couple of ReleasePostmasterChildSlot calls in error paths; this
part backpatched to 8.4 which is when the child slot stuff was introduced.
2009-08-24 17:23:02 +00:00
Tom Lane 9b708f1f57 Fix inclusions of readline/editline header files so that we only attempt to
#include the version of history.h that is in the same directory as the
readline.h we are using.  This avoids problems in some scenarios where both
readline and editline are installed.  Report and patch by Zdenek Kotala.
2009-08-24 16:18:13 +00:00
Alvaro Herrera 1e6bd556d8 Remove unused variable.
Per Grzegorz Jaskiewicz report from LLVM static checker
2009-08-24 14:15:09 +00:00
Tom Lane 3bee0a4642 Run the "tablespace" regression test first not last. The former placement
renders useless one of the few test methodologies we have for WAL replay,
which is to intentionally crash the system just after completing the
regression tests and see if it recovers to the expected database state.
The reason is that DROP TABLESPACE forces a checkpoint, so there's essentially
no WAL available for replay after the tests complete.
2009-08-24 03:10:16 +00:00
Tom Lane 7fc7a7c4d0 Fix a violation of WAL coding rules in the recent patch to include an
"all tuples visible" flag in heap page headers.  The flag update *must*
be applied before calling XLogInsert, but heap_update and the tuple
moving routines in VACUUM FULL were ignoring this rule.  A crash and
replay could therefore leave the flag incorrectly set, causing rows
to appear visible in seqscans when they should not be.  This might explain
recent reports of data corruption from Jeff Ross and others.

In passing, do a bit of editorialization on comments in visibilitymap.c.
2009-08-24 02:18:32 +00:00
Tom Lane cab9a0656c Make TRUNCATE do truncate-in-place when processing a relation that was created
or previously truncated in the current (sub)transaction.  This is safe since
if the (sub)transaction later rolls back, we'd just discard the rel's current
physical file anyway.  This avoids unreasonable growth in the number of
transient files when a relation is repeatedly truncated.  Per a performance
gripe a couple weeks ago from Todd Cook.
2009-08-23 19:23:41 +00:00
Tom Lane c38b75947e Tweak ExecIndexEvalRuntimeKeys to forcibly detoast any toasted comparison
values before they get passed to the index access method.  This avoids
repeated detoastings that will otherwise ensue as the comparison value
is examined by various index support functions.  We have seen a couple of
reports of cases where repeated detoastings result in an order-of-magnitude
slowdown, so it seems worth adding a bit of extra logic to prevent this.

I had previously proposed trying to avoid duplicate detoastings in general,
but this fix takes care of what seems the most important case in practice
with very little effort or risk.

Back-patch to 8.4 so that the PostGIS folk won't have to wait a year to
have this fix in a production release.  (The issue exists further back,
of course, but the code's diverged enough to make backpatching further a
higher-risk action.  Also it appears that the possible gains may be limited
in prior releases because of different handling of lossy operators.)
2009-08-23 18:26:08 +00:00
Tom Lane 56e985d02e Include resjunk columns in EXPLAIN VERBOSE output lists. Per discussion. 2009-08-22 02:06:32 +00:00
Tom Lane e59686f029 Fix version_stamp.pl to allow 'alphaN' version stamps. Not sure how
Peter did that without fixing this ...
2009-08-19 15:03:56 +00:00
Tom Lane be4cd18f71 Allow mixing of traditional and SQL:2008 LIMIT/OFFSET syntax. Being rigid
about it doesn't simplify the grammar at all, and it does invite confusion
among those who only read the SELECT syntax summary and not the full details.
Per gripe from Jaime Casanova.
2009-08-18 23:40:20 +00:00
Andrew Dunstan 514c3f19a2 Pick up REGRESS_OPTS from contrib makefiles. Along the way, fix ordering of makefile tests to mimic gmake. 2009-08-18 22:36:56 +00:00
Tom Lane 3bd2241135 Fix overflow for INTERVAL 'x ms' where x is more than a couple million,
and integer datetimes are in use.  Per bug report from Hubert Depesz
Lubaczewski.

Alex Hunsaker
2009-08-18 21:23:14 +00:00
Teodor Sigaev a88a48011c Introduce filtering dictionary support to tsearch. Propagate --nolocale option
to CREATE DATABASE command in pg_regress to allow correct checking of
locale-sensitive contrib modules.
2009-08-18 10:30:41 +00:00
Tom Lane 67a5f8ff9e Department of marginal improvements: teach tupconvert.c to avoid doing a
physical conversion when there are dropped columns in the same places in
the input and output tupdescs.  This avoids possible performance loss from
the recent patch to improve dropped-column handling, in some cases where
the old code would have worked.
2009-08-17 20:34:31 +00:00
Tom Lane 785cfee031 Fix incorrect encoding-aware name truncation in makeArrayTypeName().
truncate_identifier won't do anything if the passed-in strlen is already
less than NAMEDATALEN, which it always would be given the strlcpy usage.
This has been broken since the arrays-of-composite-types code went in.

Arguably truncate_identifier is suffering from excessive optimization
and should always process the string, but for the moment I'll take the
more localized patch.

Per bug #4987.
2009-08-16 18:14:34 +00:00
Tom Lane a05a4b478d Remove Wisconsin benchmark files.
This test is clearly not being used anymore, since it's been broken for
long periods of time without anyone noticing.  Per discussion, it's not
worth keeping in our source tree.
2009-08-15 16:16:01 +00:00
Peter Eisentraut efc1aeb85a Remove the test case that depends on the platform's float output format. 2009-08-14 23:25:51 +00:00
Tom Lane 3718b0c50d Repair breakage of Wisconsin benchmark due to change of command line syntax
for standalone backends.

Although we probably ought to just remove this long-obsolete test case from
our code, it seems worthwhile to document the issue and fix in CVS first.

Jeff Janes
2009-08-14 18:49:34 +00:00
Teodor Sigaev abd8c94ff9 Add prefix support for synonym dictionary 2009-08-14 14:53:20 +00:00
Peter Eisentraut 0c738084fb PL/Python regression tests for data type handling
Add some checks on various data types are converted into and out of Python.
This is extracted from Caleb Welton's patch for improved bytea support,
but much expanded.
2009-08-14 13:42:16 +00:00
Michael Meskes cf37d68467 Made sure sqlca is reset for declare cursor in Informix mode as pointed out by
Böszörményi Zoltán <zb@cybertec.at>.
2009-08-14 13:28:22 +00:00
Peter Eisentraut c74d8a7708 Domain support in PL/Python
When examining what Python type to convert a PostgreSQL type to on input,
look at the base type of the input type, otherwise all domains end up
defaulting to string.
2009-08-14 13:12:21 +00:00
Peter Eisentraut 7902338192 Remove stray character in type description 2009-08-13 21:14:31 +00:00
Peter Eisentraut cfe380a6dd Augment test coverage in PL/Python, especially for error conditions. 2009-08-13 20:50:05 +00:00
Tom Lane 501255114d Add a simple test case covering a join against an inheritance tree,
since we're evidently not testing that at all right now :-(
2009-08-13 17:14:38 +00:00
Tom Lane f959390cd0 Put back adjust_appendrel_attrs()'s code for dealing with RestrictInfo.
I mistakenly removed it last month, thinking it was no longer needed ---
but it is still needed for dealing with joininfo lists.  Fortunately this
bit of brain fade hadn't made it into any released versions yet.
2009-08-13 16:53:09 +00:00
Tom Lane b6bde524af Improve error message for the case where a requested foreign key constraint
does match some unique index on the referenced table, but that index is
only deferrably unique.  We were doing this nicely for the
default-to-primary-key case, but were being lazy for the other case.

Dean Rasheed
2009-08-12 23:00:12 +00:00
Tom Lane 04011cc970 Allow backends to start up without use of the flat-file copy of pg_database.
To make this work in the base case, pg_database now has a nailed-in-cache
relation descriptor that is initialized using hardwired knowledge in
relcache.c.  This means pg_database is added to the set of relations that
need to have a Schema_pg_xxx macro maintained in pg_attribute.h.  When this
path is taken, we'll have to do a seqscan of pg_database to find the row
we need.

In the normal case, we are able to do an indexscan to find the database's row
by name.  This is made possible by storing a global relcache init file that
describes only the shared catalogs and their indexes (and therefore is usable
by all backends in any database).  A new backend loads this cache file,
finds its database OID after an indexscan on pg_database, and then loads
the local relcache init file for that database.

This change should effectively eliminate number of databases as a factor
in backend startup time, even with large numbers of databases.  However,
the real reason for doing it is as a first step towards getting rid of
the flat files altogether.  There are still several other sub-projects
to be tackled before that can happen.
2009-08-12 20:53:31 +00:00
Tom Lane a1f0c9bab9 Fix old bug in log_autovacuum_min_duration code: it was relying on being able
to access a Relation entry it had just closed.  I happened to be testing with
CLOBBER_CACHE_ALWAYS, which made this a guaranteed core dump (at least on
machines where sprintf %s isn't forgiving of a NULL pointer).  It's probably
quite unlikely that it would fail in the field, but a bug is a bug.  Fix by
moving the relation_close call down past the logging action.
2009-08-12 18:23:49 +00:00
Peter Eisentraut 9d9848668f Split the plpython regression test into test cases arranged by topic, instead
of the previous monolithic setup-create-run sequence, that was apparently
inherited from a previous test infrastructure, but makes working with the
tests and adding new ones weird.
2009-08-12 16:37:26 +00:00
Alvaro Herrera 55f927a46e Refactor NUM_cache_remove calls in error report path to a PG_TRY block.
The code in the new block was not reindented; it will be fixed by pgindent
eventually.
2009-08-10 20:16:05 +00:00
Tom Lane e61fd4ac74 Support EEEE (scientific notation) in to_char().
Pavel Stehule, Brendan Jurd
2009-08-10 18:29:27 +00:00
Bruce Momjian 933b17b663 Adjust test_fsync code to be more sane.
Backpatch to 8.4.X.
2009-08-10 18:19:06 +00:00
Tom Lane 9bd27b7c9e Extend EXPLAIN to support output in XML or JSON format.
There are probably still some adjustments to be made in the details
of the output, but this gets the basic structure in place.

Robert Haas
2009-08-10 05:46:50 +00:00
Peter Eisentraut ed9208829a Ship documentation without intermediate tarballs
Documentation files in HTML and man formats are now prepared for
distribution using the distprep make target, like everything else.  They
are placed in doc/src/sgml/html and manX and installed from there by
make install, if present.  The business with the tarballs in the tarball
is gone.
2009-08-09 22:47:59 +00:00
Tom Lane 97e14f6e93 Document that LocalSetXLogInsertAllowed can be re-executed.
Per comment from Simon.
2009-08-08 16:39:17 +00:00
Tom Lane f033f6d28b Modify parallel pg_restore to track pending and ready items by means of
two new lists, rather than repeatedly rescanning the main TOC list.
This avoids a potential O(N^2) slowdown, although you'd need a *lot*
of tables to make that really significant; and it might simplify future
improvements in the scheduling algorithm by making the set of ready
items more easily inspectable.  The original thought that it would
in itself result in a more efficient job dispatch order doesn't seem
to have been borne out in testing, but it seems worth doing anyway.
2009-08-07 22:48:34 +00:00
Peter Eisentraut 7798147a76 Expand test coverage support to entire tree
Test coverage support now covers the entire source tree, including
contrib, instead of just src/backend.  In a related but independent
development, the commands make coverage and make coverage-html can be run
in any directory.

This turned out to be much easier than feared.  Besides a few ad hoc fixes
to pass the make target down the tree, change all affected makefiles to
list their directories in the SUBDIRS variable, changed from variants like
DIRS and WANTED_DIRS.  MSVC build fix was attempted as well.
2009-08-07 20:50:22 +00:00
Tom Lane e605fbcccd Try to defend against the possibility that libpq is still in COPY_IN state
when we reach the post-COPY "pump it dry" error recovery code that was added
2006-11-24.  Per a report from Neil Best, there is at least one code path
in which this occurs, leading to an infinite loop in code that's supposed
to be making it more robust not less so.  A reasonable response seems to be
to call PQputCopyEnd() again, so let's try that.

Back-patch to all versions that contain the cleanup loop.
2009-08-07 20:16:11 +00:00
Tom Lane 87740caa01 rm_cleanup functions need to be allowed to write WAL entries. This oversight
appears to explain the recent reports of "PANIC: cannot make new WAL entries
during recovery".
2009-08-07 19:29:49 +00:00
Bruce Momjian d2e7afe54a Remove unused ecpg variable. 2009-08-07 16:47:53 +00:00
Tom Lane 3783c9d4df Remove long-since-unused file commands/version.h.
Noticed by Itagaki Takahiro.
2009-08-07 16:19:57 +00:00
Tom Lane b1114f5576 Fix some omissions in the dependency-object-class support for SQL/MED objects.
Main problem found by Muhammad Aqeel, some cosmetic additions by me.
2009-08-07 15:27:56 +00:00