Peter Eisentraut [Thu, 18 Dec 2003 18:55:06 +0000 (18:55 +0000)]
Move Informix compatibility include files out of the way. compatlib.h
was integrated into ecpg_informix.h, the other ones go into their own
subdirectory that is automatically considered by the embedded preprocessor
when in Informix mode.
Tom Lane [Wed, 17 Dec 2003 22:11:42 +0000 (22:11 +0000)]
information_schema.constraint_column_usage and key_column_usage should
not discriminate against system columns, since we support constraints on
system columns, and in fact constraints on OID are moderately useful.
Tom Lane [Wed, 17 Dec 2003 19:49:52 +0000 (19:49 +0000)]
Reorder tests in parse_coerce so that ANY/ANYELEMENT/ANYARRAY coercion
does not affect UNKNOWN-type literals or Params. This fixes the recent
complaint about count('x') being broken, and improves consistency in
a few other respects too.
Tom Lane [Wed, 17 Dec 2003 17:08:06 +0000 (17:08 +0000)]
Repair planner failure when there are multiple IN clauses, each with
a join in its subselect. In this situation we *must* build a bushy
plan because there are no valid left-sided or right-sided join trees.
Accordingly, hoary sanity check needs an update. Per report from
Alessandro Depase.
Tom Lane [Tue, 9 Dec 2003 01:56:41 +0000 (01:56 +0000)]
query_tree_mutator should copy RangeTblEntry nodes even when it's not
planning to modify them itself. Otherwise we end up with shared RTE
substructure, which breaks inheritance_planner because the rte->inh
flag needs to be independent in each copied subquery. Per bug report
from Chris Piker.
Tom Lane [Mon, 8 Dec 2003 18:20:10 +0000 (18:20 +0000)]
Whole-row references were broken for subqueries and functions, because
attr_needed/attr_widths optimization failed to allow for Vars with attno
zero in this case. Per report from Tatsuo Ishii.
Tom Lane [Sun, 7 Dec 2003 19:43:13 +0000 (19:43 +0000)]
Remove test on c.relkind from check_constraints view; unnecessary and
prevents view from showing constraints on domains. This addresses the
other half of Claus Colloseus' bug report.
Joe Conway [Sun, 7 Dec 2003 04:12:50 +0000 (04:12 +0000)]
Repair indexed bytea like operations, and related selectivity
functionality. Per bug report by Alvar Freude:
http://archives.postgresql.org/pgsql-bugs/2003-12/msg00022.php
Tom Lane [Wed, 3 Dec 2003 17:45:38 +0000 (17:45 +0000)]
Planner failed to be smart about binary-compatible expressions in pathkeys
and hash bucket-size estimation. Issue has been there awhile but is more
critical in 7.4 because it affects varchar columns. Per report from
Greg Stark.
Bruce Momjian [Tue, 2 Dec 2003 12:40:08 +0000 (12:40 +0000)]
The attached patch enables contrib/cube to build cleanly under Cygwin
(again). Please consider this patch for the 7.4.1 branch (if there
will be one) too.
Bruce Momjian [Mon, 1 Dec 2003 23:19:54 +0000 (23:19 +0000)]
I've run across a pretty serious problem with pg_autovacuum.
pg_autovacuum looses track of any table that's ever been truncated
(possibly other situations too). When i truncate a table it gets a
new relfilenode in pg_class. This is a problem because pg_autovacuum
assumes pg_class.relfilenode will join to pg_stats_all_tables.relid.
pg_stats_all_tables.relid is actallly the oid from pg_class, not the
relfilenode. These two values start out equal so pg_autovacuum works
initially, but it fails later on because of this incorrect assumption.
This patch fixes that problem. Applied to HEAD and 7.4.X.
Bruce Momjian [Mon, 1 Dec 2003 23:14:29 +0000 (23:14 +0000)]
I noticed in the 7.4 release that in contrib/pg_autovacuum, args->logfile is
not initialized if a log file is not specified on the command line. This
causes an immediate segfault on systems that fill allocated memory with some
value other than zero (my FreeBSD machine uses 0xD0).
Several crashes later I discovered that args->user, password, host, and port
are also used without being initialized.
This doesn't appear to be fixed in CVS and I came up empty on a mailing list
search -- hope it hasn't been reported already.
Tom Lane [Mon, 1 Dec 2003 16:53:30 +0000 (16:53 +0000)]
Force zero_damaged_pages to be effectively ON during recovery from WAL,
since there is no need to worry about damaged pages when we are going to
overwrite them anyway from the WAL. Per recent discussion.
Joe Conway [Sun, 30 Nov 2003 20:53:43 +0000 (20:53 +0000)]
Make PQescapeBytea and byteaout consistent with each other, and
octal escape all octets outside the range 0x20 to 0x7e. This fixes
the problem pointed out by Sergey Yatskevich here:
http://archives.postgresql.org/pgsql-bugs/2003-11/msg00140.php
Joe Conway [Fri, 28 Nov 2003 05:03:48 +0000 (05:03 +0000)]
Fix regression in dblink_disconnect() reported by Eduardo Stern:
persistent_conn was left dangling after a disconnect in the
unnamed connection case, causing a subsequent disconnect to
crash the backend.
Tom Lane [Wed, 26 Nov 2003 20:50:26 +0000 (20:50 +0000)]
Second try at fixing no-room-to-move-down PANIC in compact_fsm_storage.
Ward's report that it can still happen in RC2 forces me to realize that
this is not a can't-happen condition after all, and that the compaction
code had better cope rather than panicking.
Tom Lane [Tue, 25 Nov 2003 23:59:32 +0000 (23:59 +0000)]
Repair subselect.c's occasional assignment of the wrong vartypmod to
Vars created to fill subplan args lists. This is an ancient error, going
back at least to 7.0, but is more easily triggered in 7.4 than before
because we no longer compare varlevelsup when deciding whether a Param
slot can be re-used. Fixes bug reported by Klint Gore.
Tom Lane [Tue, 25 Nov 2003 19:17:16 +0000 (19:17 +0000)]
Band-aid solution for problems with SubPlans used in hash join clauses,
per report from Andrew Holm-Hansen. The difficulty arises from the fact
that the planner allowed a Hash node's hashkeys to share substructure
with the parent HashJoin node's hashclauses, plus some rather bizarre
choices about who initializes what during executor startup. A cleaner
but more invasive solution is to not store hashkeys separately in the
plan tree at all, but let the HashJoin node deconstruct hashclauses
during executor startup. I plan to fix it that way in HEAD.
Tom Lane [Mon, 24 Nov 2003 16:54:15 +0000 (16:54 +0000)]
Overdue code review for ALTER SEQUENCE patch. Don't generate illegal Node
tree for CYCLE option; don't assume zeros are invalid values for sequence
fields other than increment_by; don't reset cache_value when not told to;
simplify code for testing whether to apply defaults.
Peter Eisentraut [Mon, 24 Nov 2003 13:11:27 +0000 (13:11 +0000)]
Rename USE_THREADS to ENABLE_THREAD_SAFETY to avoid name clash with Perl.
Fixes compliation failure with --enable-thread-safety --with-perl and Perl
5.6.1.
Tom Lane [Sun, 16 Nov 2003 20:29:34 +0000 (20:29 +0000)]
Fix datetime input parsing to accept YYYY-MONTHNAME-DD and related syntaxes,
which had been unintentionally broken by recent changes to tighten up the
DateStyle rules for all-numeric date input. Add documentation and
regression tests for this, too.
Tom Lane [Sat, 15 Nov 2003 17:24:19 +0000 (17:24 +0000)]
Make creation of statistics collection socket more robust, by allowing it
to try additional addresses returned from getaddrinfo() if the first one
fails at the bind() or connect() steps. Per yesterday's discussion.
Tom Lane [Fri, 14 Nov 2003 22:56:25 +0000 (22:56 +0000)]
Repair error in syntax documentation for CREATE TABLE: one does not put
a comma between multiple column_constraint's for a single column.
Per report from Tomislaw Kitynski.