Commit Graph

16182 Commits

Author SHA1 Message Date
Bruce Momjian c0dc166adc Use better named loop variable for large loop, rather than 'i'. 2006-08-06 02:00:52 +00:00
Tom Lane 635d42e9c3 Fix inheritance_planner() to delete dummy subplans from its Append plan
list, when some of the child rels have been excluded by constraint
exclusion.  This doesn't save a huge amount of time but it'll save some,
and it makes the EXPLAIN output look saner.  We already did the
equivalent thing in set_append_rel_pathlist(), but not here.
2006-08-05 17:21:52 +00:00
Michael Meskes 1d28bf2589 Two more changes to regression tests to fix two differences in different setups. 2006-08-05 16:48:48 +00:00
Tom Lane 5f789c5ead Extend relation_excluded_by_constraints() to check for mutually
contradictory WHERE-clauses applied to a relation.  This makes the
GUC variable constraint_exclusion rather inappropriately named,
but I've refrained for the moment from renaming it.
Per example from Martin Lesser.
2006-08-05 00:22:49 +00:00
Tom Lane 6357f4ea72 Teach predicate_refuted_by() how to do proofs involving NOT-clauses.
This doesn't matter too much for ordinary NOTs, since prepqual.c does
its best to get rid of those, but it helps with IS NOT TRUE clauses
which the rule rewriter likes to insert.  Per example from Martin Lesser.
2006-08-05 00:21:14 +00:00
Bruce Momjian 3f23f4eec8 Add some blank lines for formatting. 2006-08-04 22:20:06 +00:00
Tom Lane c68489863c Fix domain_in() bug exhibited by Darcy Buskermolen. The idea of an EState
that's shorter-lived than the expression state being evaluated in it really
doesn't work :-( --- we end up with fn_extra caches getting deleted while
still in use.  Rather than abandon the notion of caching expression state
across domain_in calls altogether, I chose to make domain_in a bit cozier
with ExprContext.  All we really need for evaluating variable-free
expressions is an ExprContext, not an EState, so I invented the notion of a
"standalone" ExprContext.  domain_in can prevent resource leakages by doing
a ReScanExprContext on this rather than having to free it entirely; so we
can make the ExprContext have the same lifespan (and particularly the same
per_query memory context) as the expression state structs.
2006-08-04 21:33:36 +00:00
Bruce Momjian bf7b205e16 #ifdef fix for MSVC builds of libpq.
Hiroshi Saito
2006-08-04 18:58:33 +00:00
Bruce Momjian c8961bf1ce Improve logging of protocol-level prepared statements. 2006-08-04 18:53:46 +00:00
Bruce Momjian ad269d5e3b Fix bug in new pg_dump -T/-N handling that was dumping system schemas if
these options were used before -n/-t.
2006-08-04 18:32:15 +00:00
Tom Lane 6db6714ffc Remove redeclaration of struct sqlca_t --- unnecessary and provokes
warnings on some compilers.
2006-08-04 16:54:05 +00:00
Tom Lane 3467758809 Fix missing 'static' keywords --- some compilers gripe about this. 2006-08-04 16:42:56 +00:00
Tom Lane 5d844d3271 'make clean' must remove the create subdirectories results/ and log/,
not merely remove their contents.  Else 'cvs update' complains.
2006-08-04 14:18:09 +00:00
Tom Lane e2d34d75e7 Teach eval_const_expressions to simplify BooleanTest nodes that have
constant input.  Seems worth doing because rule rewriter inserts
IS NOT TRUE tests into WHERE clauses.
2006-08-04 14:09:51 +00:00
Michael Meskes 3ceaa97b3c Regression test updates and fixes 2006-08-04 08:52:18 +00:00
Bruce Momjian 9ac2f2e8ea Add missing ecpg function prototype needed when in threaded mode ---
supresses compiler warning.
2006-08-04 03:23:37 +00:00
Tom Lane c82264291e Add some basic tests of GUC behavior.
Joachim Wieland
2006-08-04 00:00:14 +00:00
Tom Lane 7946f77220 Cause ALTER TABLE to perform ALTER COLUMN DROP DEFAULT operations during
the DROP pass rather than the ADD_CONSTR pass.  On examining the code I
think this was just an oversight rather than intentional, and it seems
to satisfy the principle of least surprise better than the alternative
solution that was discussed.  Add an example to the ref page showing how
to do ALTER TYPE and update the default in one command.  Per gripe from
Markus Bertheau that that wasn't possible.
2006-08-03 20:57:06 +00:00
Tom Lane 89c07b18a6 Remove use of a regex character class in resultmap (for freebsd version
check).  This isn't supported by pg_regress since the recent rewrite
into C.  While we could add char classes to pg_regress.c's code, it's
not really needed at the moment: thanks to Andrew's patch to make
pg_regress always accept the 'standard' comparison file, we can just
drop the version check.
2006-08-03 17:04:00 +00:00
Tom Lane f5b78fa51f Fix AfterTriggerExecute() to pass tg_trigtuple and tg_newtuple as NULLs
rather than pointers to garbage, when calling AFTER STATEMENT triggers.
Michael Fuhr
2006-08-03 16:04:41 +00:00
Tom Lane bc8ac3ce40 Add missing pgstat_count_index_scan(), per Andreas Seltenreich. 2006-08-03 15:22:09 +00:00
Tom Lane d841cc44c5 A few regression tests for VALUES, from Gavin Sherry. 2006-08-03 14:54:44 +00:00
Michael Meskes 4b8378a671 Removed compiler warnings 2006-08-03 14:50:11 +00:00
Michael Meskes 27458bb4fa Applied test suite update by Joachim Wieland <joe@mcknight.de>. 2006-08-03 13:11:04 +00:00
Bruce Momjian 961ec0ce9c Move 'ddl' right after 'none' in postgresql.conf. It used to be between
'mod' and 'all', which is not the right order.  SGML documentation order
was correct. Report from Chander Ganesan.
2006-08-02 21:48:43 +00:00
Bruce Momjian f1fa94a415 Fix logic to prevent pg_dump from dumping system schemas; bug introduced
in recent -t/-n/-T/-N patch.

Small style cleanups.
2006-08-02 21:43:43 +00:00
Andrew Dunstan 959aee5bbf remove extraneous space after -L flag. 2006-08-02 19:02:34 +00:00
Tom Lane 0dfb595d7a Arrange for ValuesScan to keep per-sublist expression eval state in a
temporary context that can be reset when advancing to the next sublist.
This is faster and more thorough at recovering space than the previous
method; moreover it will do the right thing if something in the sublist
tries to register an expression context callback.
2006-08-02 18:58:21 +00:00
Michael Meskes efc861a842 And finally the Makefiles 2006-08-02 14:19:14 +00:00
Tom Lane e79aed7cba Wups, got the test for contain_vars_of_level-not-needed wrong in
transformInsertStmt: the target table is already in p_rtable at that point.
2006-08-02 14:14:22 +00:00
Michael Meskes 1f0a6cd60c Hopefully that's it. The remaining files for ecpg regression tests. 2006-08-02 14:14:04 +00:00
Tom Lane 6392518c69 Add a HINT per suggestion from Michael Glaesemann. Also, tweak OLD/NEW
test to avoid expensive contain_vars_of_level() scan in the normal case
where we're not inside a rule.
2006-08-02 13:58:52 +00:00
Michael Meskes b737f85e84 Some more regression test files 2006-08-02 13:53:45 +00:00
Michael Meskes 2682a4c01d One more file to remove 2006-08-02 13:52:11 +00:00
Michael Meskes 36e8d4e780 Removed old test files 2006-08-02 13:51:32 +00:00
Michael Meskes 1fa6be6f69 ynced parser and keyword list.
Implemented EXEC SQL UNDEF.
Applied first version of the regression test patch by Joachim Wieland <joe@mcknight.de>.
2006-08-02 13:43:23 +00:00
Joe Conway 9caafda579 Add support for multi-row VALUES clauses as part of INSERT statements
(e.g. "INSERT ... VALUES (...), (...), ...") and elsewhere as allowed
by the spec. (e.g. similar to a FROM clause subselect). initdb required.
Joe Conway and Tom Lane.
2006-08-02 01:59:48 +00:00
Bruce Momjian d307c428cb Fix bug I introduced while cleaning up pg_dump -t/-n patch. 2006-08-01 21:05:00 +00:00
Bruce Momjian 2c6d96cef6 Add support for loadable modules to allocated shared memory and
lightweight locks.

Marc Munro
2006-08-01 19:03:11 +00:00
Bruce Momjian c61607bd52 Add pg_dump -X no-data-for-failed-tables option to suppress loading data
if table creation failed (the table already exists).

Martin Pitt
2006-08-01 18:21:44 +00:00
Bruce Momjian 8977b68a42 Allow multiple -n (schema) and -t (table) pg_dump options, and add -T
and -N options to exclude objects.  Also support regular expressions for
option object names.

Greg Sabino Mullane
2006-08-01 18:05:04 +00:00
Bruce Momjian 9a4eaa9440 Remove extra argument to printf(). 2006-08-01 18:01:36 +00:00
Andrew Dunstan a3bae60813 have pg_regress fall back on testing with the canonical results file if an
alternative test is specified but none succeeds.
2006-08-01 14:56:29 +00:00
Tom Lane 09d3670df3 Change the relation_open protocol so that we obtain lock on a relation
(table or index) before trying to open its relcache entry.  This fixes
race conditions in which someone else commits a change to the relation's
catalog entries while we are in process of doing relcache load.  Problems
of that ilk have been reported sporadically for years, but it was not
really practical to fix until recently --- for instance, the recent
addition of WAL-log support for in-place updates helped.

Along the way, remove pg_am.amconcurrent: all AMs are now expected to support
concurrent update.
2006-07-31 20:09:10 +00:00
Michael Meskes 4cd72b53b9 Added missing ECPGget_sqlca() call 2006-07-31 13:26:46 +00:00
Michael Meskes c1c9b7c0c0 First small patches needed for regression tests 2006-07-31 10:15:31 +00:00
Tom Lane 6e38e34d64 Change the bootstrap sequence so that toast tables for system catalogs are
created in the bootstrap phase proper, rather than added after-the-fact
by initdb.  This is cleaner than before because it allows us to retire the
undocumented ALTER TABLE ... CREATE TOAST TABLE command, but the real reason
I'm doing it is so that toast tables of shared catalogs will now have
predetermined OIDs.  This will allow a reasonably clean solution to the
problem of locking tables before we load their relcache entries, to appear
in a forthcoming patch.
2006-07-31 01:16:38 +00:00
Tom Lane 8822263635 Fix a couple of comments. 2006-07-30 20:17:11 +00:00
Michael Meskes 0bee536ad8 Replaced $Header$ by $§PosgreSQL$ 2006-07-30 16:28:58 +00:00
Michael Meskes cdf131abac Added missing $Header$ entries. 2006-07-30 10:24:10 +00:00
Alvaro Herrera 92c2ecc130 Modify snapshot definition so that lazy vacuums are ignored by other
vacuums.  This allows a OLTP-like system with big tables to continue
regular vacuuming on small-but-frequently-updated tables while the
big tables are being vacuumed.

Original patch from Hannu Krossing, rewritten by Tom Lane and updated
by me.
2006-07-30 02:07:18 +00:00
Bruce Momjian 1a271f0c71 Fix WIN32 wait() return value macros to be accurate, particularly
because they are used for testing the return value from system().
(WIN32 doesn't overlay the return code with other failure conditions
like Unix does, so they are just simple macros.)

Fix regression checks to properly handle diff failures on Win32 using
the new macros.
2006-07-30 01:45:21 +00:00
Andrew Dunstan 497d39d768 prevent multiplexing Windows kernel event objects we listen for across various sockets - should fix the occasional stats test regression failures we see. 2006-07-29 19:55:18 +00:00
Bruce Momjian e5ac3d4343 Don't use #include <crtdefs.h> for MSVC <= 1400.
Hiroshi Saito
2006-07-29 17:35:07 +00:00
Bruce Momjian b554cb75bf Add #include postgres_fe.h in two win32-specific files, because there is
pg-specific code in those files, or might be some day.
2006-07-29 15:22:27 +00:00
Tom Lane 033a477e9e Adjust initialization sequence for timezone_abbreviations so that
it's handled just about like timezone; in particular, don't try
to read anything during InitializeGUCOptions.  Should solve current
startup failure on Windows, and avoid wasted cycles if a nondefault
setting is specified in postgresql.conf too.  Possibly we need to
think about a more general solution for handling 'expensive to set'
GUC options.
2006-07-29 03:02:56 +00:00
Tom Lane 1249cf8f38 SQL2003-standard statistical aggregates, by Sergey Koposov. I've added only
the float8 versions of the aggregates, which is all that the standard requires.
Sergey's original patch also provided versions using numeric arithmetic,
but given the size and slowness of the code, I doubt we ought to include
those in core.
2006-07-28 18:33:04 +00:00
Michael Meskes 76475a7eb5 Variables should be free'ed only once. 2006-07-28 11:49:36 +00:00
Michael Meskes a27cb17788 Removed superfluous comment 2006-07-28 10:12:56 +00:00
Michael Meskes 9e76b4c7c5 And one more:
Connection identifier has to be unique
2006-07-28 10:10:42 +00:00
Michael Meskes 72ba3cb50f Added more SoC changes by Joachim Wieland <joe@mcknight.de>:
- SHOW statement puts result into a variable
	- COPY TO STDOUT works
2006-07-28 09:08:01 +00:00
Tom Lane 108fe47301 Aggregate functions now support multiple input arguments. I also took
the opportunity to treat COUNT(*) as a zero-argument aggregate instead
of the old hack that equated it to COUNT(1); this is materially cleaner
(no more weird ANYOID cases) and ought to be at least a tiny bit faster.
Original patch by Sergey Koposov; review, documentation, simple regression
tests, pg_dump and psql support by moi.
2006-07-27 19:52:07 +00:00
Tom Lane 8aab197840 Original coding of pg_regress.c made the results and log directories
with restrictive permissions, which was not the behavior of the shell
script and doesn't seem very desirable.  Use the umask setting instead.
2006-07-27 15:37:19 +00:00
Bruce Momjian 43c79378c8 Allow LDAP lookups from pg_service.conf.
Albe Laurenz
2006-07-27 13:20:24 +00:00
Peter Eisentraut b517e65348 Allow units to be specified with configuration settings. 2006-07-27 08:30:41 +00:00
Tom Lane a998a69247 Code review for bigint-LIMIT patch. Fix missed planner dependency,
eliminate unnecessary code, force initdb because stored rules change
(limit nodes are now supposed to be int8 not int4 expressions).
Update comments and error messages, which still all said 'integer'.
2006-07-26 19:31:51 +00:00
Bruce Momjian 9a7483714f Work around bug in strxfmt() but in MS VS2005.
William ZHANG
2006-07-26 17:17:28 +00:00
Peter Eisentraut cd2a6b57c0 When a GUC string variable is not set, print the empty string (in SHOW etc.),
not "unset".  An "unset" state doesn't really exist; all variables behave
like an empty string value if the string being pointed to has not been
initialized.
2006-07-26 11:39:47 +00:00
Peter Eisentraut 79bc99a467 Convert effective_cache_size to an integer, for better integration with
upcoming units feature.
2006-07-26 11:35:56 +00:00
Bruce Momjian 085e559654 Change LIMIT/OFFSET to use int8
Dhanaraj M
2006-07-26 00:34:48 +00:00
Tom Lane e6284649b9 Modify btree to delete known-dead index entries without an actual VACUUM.
When we are about to split an index page to do an insertion, first look
to see if any entries marked LP_DELETE exist on the page, and if so remove
them to try to make enough space for the desired insert.  This should reduce
index bloat in heavily-updated tables, although of course you still need
VACUUM eventually to clean up the heap.

Junji Teramoto
2006-07-25 19:13:00 +00:00
Tom Lane bd112776cd Add missing @OVERRIDE to 'India' config file, per Michael Fuhr.
Add $PostgreSQL$ lines for CVS identity, too.
2006-07-25 13:49:21 +00:00
Tom Lane d8b5c95ca8 Remove hard-wired lists of timezone abbreviations in favor of providing
configuration files that can be altered by a DBA.  The australian_timezones
GUC setting disappears, replaced by a timezone_abbreviations setting (set this
to 'Australia' to get the effect of australian_timezones).  The list of zone
names defined by default has undergone a bit of cleanup, too.  Documentation
still needs some work --- in particular, should we fix Table B-4, or just get
rid of it?  Joachim Wieland, with some editorializing by moi.
2006-07-25 03:51:23 +00:00
Andrew Dunstan 631ea61883 Use correct ifdef test for cygwin, namely __CYGWIN__ (note underscores). 2006-07-25 01:37:42 +00:00
Tom Lane d0e4a076d1 Make the order of operations in PostmasterMain a bit saner ... some
recent patches had added stuff in rather random spots.
2006-07-25 01:23:34 +00:00
Peter Eisentraut e9b4969062 DTrace support, with a small initial set of probes
by Robert Lor
2006-07-24 16:32:45 +00:00
Peter Eisentraut 9dc34b5feb Mark postgresql.conf entries that require server restart; some minor
editing and reformatting.
2006-07-24 10:44:40 +00:00
Andrew Dunstan 20a733d0a0 Remove dubious and redundant (we think) setting of libdir in PATH for non temp-install case. 2006-07-24 01:50:22 +00:00
Tom Lane 8dcaea7be0 Add a fudge factor to genericcostestimate() to prevent the planner from
thinking that indexes of different sizes are equally attractive.  Per
gripe from Jim Nasby.  (I remain unconvinced that there's such a problem
in existing releases, but CVS HEAD definitely has got a problem because
of its new count-only-leaf-pages approach to indexscan costing.)
2006-07-24 01:19:48 +00:00
Tom Lane a794fb0681 Convert the lock manager to use the new dynahash.c support for partitioned
hash tables, instead of the previous kluge involving multiple hash tables.
This partially undoes my patch of last December.
2006-07-23 23:08:46 +00:00
Tom Lane b25dc481c8 Fix oversight in sizing of shared buffer lookup hashtable. Because
BufferAlloc tries to insert a new mapping entry before deleting the old one
for a buffer, we have a transient need for more than NBuffers entries ---
one more in 8.1, and as many as NUM_BUFFER_PARTITIONS more in CVS HEAD.
In theory this could lead to an "out of shared memory" failure if shmem
had already been completely claimed by the time the extra entries were
needed.
2006-07-23 18:34:45 +00:00
Tom Lane 10b9ca3d05 Split the buffer mapping table into multiple separately lockable
partitions, as per discussion.  Passes functionality checks, but
I don't have any performance data yet.
2006-07-23 03:07:58 +00:00
Tom Lane 51ee9fa157 Add support to dynahash.c for partitioning shared hashtables according
to the low-order bits of the entry hash value.  Also make some incidental
cleanups in the dynahash API, such as not exporting the hash header
structs to the world.
2006-07-22 23:04:39 +00:00
Tom Lane c0e9b3139f Hmm, seems --disable-spinlocks has been broken for awhile and nobody
noticed.  Fix SpinlockSemas() to report the correct count considering
that PG 8.1 adds a spinlock to each shared-buffer header.
2006-07-22 21:04:40 +00:00
Tom Lane 98359c3e3f In the recent changes to make the planner account better for cache
effects in a nestloop inner indexscan, I had only dealt with plain index
scans and the index portion of bitmap scans.  But there will be cache
benefits for the heap accesses of bitmap scans too, so fix
cost_bitmap_heap_scan() to account for that.
2006-07-22 15:41:56 +00:00
Andrew Dunstan b0dc1fbbc5 Add libdir to PATH for Cygwin as well as WIN32 - should fix buildfarm eel. 2006-07-22 14:05:20 +00:00
Peter Eisentraut 3b2da547e9 For automatic dependency tracking, replace our sed hackery with the GCC-
-built-in mechanism through the -MP flag.  Adjust the file extensions to
look more like Automake practice.  This frees up the .d suffix for use by
DTrace.
2006-07-21 22:37:37 +00:00
Tom Lane 0144eb92bb Add the full set of comparison functions for type TID, including a btree
opclass.  This is not so much because anyone's likely to create an index
on TID, as that sorting TIDs can be useful.  Also added max and min
aggregates while at it, so that one can investigate the clusteredness of
a table with queries like SELECT min(ctid), max(ctid) FROM tab WHERE ...
Greg Stark and Tom Lane
2006-07-21 20:51:33 +00:00
Tom Lane bc660c4237 Ah, I finally realize why Magnus wanted to add a --bindir option to
pg_regress: there's no other way to cope with testing a relocated
installation.  Seems better to call it --psqldir though, since the
only thing we need to find in that case is psql.  It'd be better if
we could use find_other_exec, but that's not happening unless we are
willing to install pg_regress alongside psql, which seems unlikely
to happen.
2006-07-21 00:24:04 +00:00
Tom Lane 11f6d2fcba As a stopgap to get the Windows buildfarm members running again, hot-wire
the check on diff's exit status to check for literally 0 or 1.  Someone
should look into why WIFEXITED/WEXITSTATUS don't work for this, but I've
spent more than enough time on it already.
2006-07-20 16:25:30 +00:00
Peter Eisentraut 679de5e573 Make pg_config location overridable for pgxs builds. 2006-07-20 09:30:18 +00:00
Tom Lane 7da24bcbc1 Print out diff status code when we think there's a hard failure.
May help in debugging behavior on Windows.
2006-07-20 03:30:58 +00:00
Tom Lane c3104376f9 Suppress unused-variable compiler warning, per Andrew Dunstan. 2006-07-20 02:15:17 +00:00
Tom Lane 27a83103ea Fix pg_regress.c to report tests in a parallel group when they finish,
not when they're started.  This mimics a subtle point of the behavior
of the old shell script, and gives better feedback when watching the
tests.
2006-07-20 02:10:00 +00:00
Tom Lane 5652ea703b Make pg_regress.c get paths from pg_config_paths.h, instead of -D
switches passed from the Makefile.  This looks like it will fix
problem with virtual vs real paths under msys.
2006-07-20 01:16:57 +00:00
Tom Lane 9dc842f083 Don't try to truncate multixact SLRU files in checkpoints done during xlog
recovery.  In the first place, it doesn't work because slru's
latest_page_number isn't set up yet (this is why we've been hearing reports
of strange "apparent wraparound" log messages during crash recovery, but
only from people who'd managed to advance their next-mxact counters some
considerable distance from 0).  In the second place, it seems a bit unwise
to be throwing away data during crash recovery anwyway.  This latter
consideration convinces me to just disable truncation during recovery,
rather than computing latest_page_number and pushing ahead.
2006-07-20 00:46:42 +00:00
Tom Lane 60cfe25e68 Adjust spawn_process() to avoid unnecessary overhead processes: we can
just exec instead of creating a subprocess.  This reduces process usage
from four processes per parallel test to two.  I have no idea whether
a comparable optimization is possible or useful in the Windows port.
2006-07-19 17:02:59 +00:00
Bruce Momjian 87c3129e2e Update WIN32 quoting roles documentation. 2006-07-19 17:01:24 +00:00
Tom Lane 5b8b137b16 Adjust pg_regress to print out the exact string given to system() when
'make install' or 'initdb' fails.  Also minor simplification of fgets()
usage --- fgets guarantees a trailing null anyway.
2006-07-19 16:23:17 +00:00
Bruce Momjian 9d9a65bfa7 Add WIN32 compile suggestion to pginclude README. 2006-07-19 15:06:06 +00:00