Commit Graph

16694 Commits

Author SHA1 Message Date
Tom Lane ee719299e4 Minor autovacuum fixes from Matthew O'Connor. 2003-12-08 21:54:00 +00:00
Tom Lane 1b5a2dbdff Add fflush() before sleeping, per Matthew O'Connor. 2003-12-08 21:51:31 +00:00
Tom Lane b281ea8cf1 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.
2003-12-08 18:19:58 +00:00
Tom Lane 918b158743 Work around naming conflict between zlib and OpenSSL by tweaking inclusion
order.  Remove some unnecessary #includes (that duplicate c.h).
2003-12-08 16:39:05 +00:00
Bruce Momjian de097903ad Done:
< * COMMENT ON [ CAST | CONVERSION | OPERATOR CLASS | LARGE OBJECT | LANGUAGE ]
> * -COMMENT ON [ CAST | CONVERSION | OPERATOR CLASS | LARGE OBJECT | LANGUAGE ]
263c263
< * Allow pg_dump to dump CREATE CONVERSION (Christopher)
> * -Allow pg_dump to dump CREATE CONVERSION (Christopher)
2003-12-08 13:04:14 +00:00
Tom Lane 9c26980f58 Replace unportable and overflow-prone use of 'long long' with safer
'double' arithmetic, per recent discussion.
2003-12-07 19:55:58 +00:00
Tom Lane 80af69ceaa 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.
2003-12-07 19:43:02 +00:00
Peter Eisentraut d9d72bcb91 Fix typmod interpretation for bit types. (It was erroneously assumed that
for bit(x), the typmod stores x+4, like for the character types.)
2003-12-07 10:21:58 +00:00
Tom Lane 649c1a11e6 One more pass at reducing the cost of pg_dump's new implementation:
reduce the number of times TopoSort() has to be executed by trying to
extract multiple dependency loops from each pass, instead of only one.
This saves about another factor of ten on the regression database.
This could be considered as another exercise in grokking Fred Brooks'
maxim: Representation *is* the essence of programming.
2003-12-07 05:44:50 +00:00
Joe Conway 53e7c1363a 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
2003-12-07 04:14:10 +00:00
Tom Lane 7bb11a93e1 Speed up findObjectByCatalogId() to get rid of the other salient
bottleneck in the new pg_dump code.
2003-12-07 03:14:01 +00:00
Bruce Momjian f8495a6b63 Done:
> * -Use dependency information to dump data in proper order
2003-12-07 00:54:05 +00:00
Joe Conway f0943278c1 Documentation update for previously committed changes: read-only GUC variables
and pg_settings view.
2003-12-06 23:10:23 +00:00
Tom Lane 79273cc7d2 Replace not-very-bright implementation of topological sort with a better
one (use a priority heap to keep track of items ready to output, instead
of searching the input array each time).  This brings the runtime of
pg_dump back to about what it was in 7.4.
2003-12-06 22:55:11 +00:00
Tom Lane 005a1217fb Massive overhaul of pg_dump: make use of dependency information from
pg_depend to determine a safe dump order.  Defaults and check constraints
can be emitted either as part of a table or domain definition, or
separately if that's needed to break a dependency loop.  Lots of old
half-baked code for controlling dump order removed.
2003-12-06 03:00:16 +00:00
Tom Lane a5ffa8fea4 Guard against bug in Solaris' bsearch(), per Michael Wildpaner. 2003-12-05 15:50:31 +00:00
Teodor Sigaev a5a68766e1 One more fix confusion 2003-12-05 15:37:51 +00:00
Teodor Sigaev 8f678600c2 Avoid confusion start_parse_str function with tsearch V1 2003-12-05 14:27:42 +00:00
Peter Eisentraut 59b1a23028 Markup improvements 2003-12-04 21:24:56 +00:00
Teodor Sigaev 6de3fe3c0d Avoid conflict strndup with glibc 2003-12-04 12:21:11 +00:00
Joe Conway 461b71f208 catversion change needed by previous read-onlu GUC variables commit. 2003-12-03 18:53:52 +00:00
Joe Conway 66989aa2d6 Added new group of read-only GUC variables to allow simple access
to certain compile-time options (FUNC_MAX_ARGS, INDEX_MAX_KEYS,
NAMEDATALEN, BLCKSZ, HAVE_INT64_TIMESTAMP). Also added "category",
"short_desc", and "extra_desc" to the pg_settings view. Per recent
discussion here:
http://archives.postgresql.org/pgsql-patches/2003-11/msg00363.php
2003-12-03 18:52:00 +00:00
Tom Lane 7f8f7665fc 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.
2003-12-03 17:45:10 +00:00
Teodor Sigaev 32580efafb Fix for word with several infinitives 2003-12-03 16:07:48 +00:00
Michael Meskes 3819afa759 Added patch by Dave Cramer for array handling in ecpglib. 2003-12-03 08:49:17 +00:00
Joe Conway e2605c8311 Add a warning to AtEOXact_SPI() to catch cases where the current
transaction has been committed without SPI_finish() being called
first. Per recent discussion here:
http://archives.postgresql.org/pgsql-patches/2003-11/msg00286.php
2003-12-02 19:26:47 +00:00
Tom Lane 0fd336c61d Update release notes for 7.3.5. 2003-12-02 16:14:12 +00:00
Peter Eisentraut 5bcdb4ccc1 Fix some small errors. 2003-12-02 10:24:37 +00:00
Tom Lane 145d9fa46c Code and docs review for numeric-factorial patch. 2003-12-02 00:26:59 +00:00
Bruce Momjian ea4b9f14f3 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.

Brian Hirt
2003-12-01 23:19:33 +00:00
Bruce Momjian 2712ca771d Fix initdb use of mkdir_p().
Andrew Dunstan
2003-12-01 23:15:47 +00:00
Bruce Momjian 15b5d6cfc6 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.

Craig Boston
2003-12-01 23:13:07 +00:00
Bruce Momjian 5ef01a28e6 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.

 Jason Tishler
2003-12-01 23:12:16 +00:00
Bruce Momjian ffb087ced5 This patch refactors execTuples.c in two ways.
Neil Conway
2003-12-01 23:09:02 +00:00
Bruce Momjian 8f61184db7 Hi, this doco patch is a quick one to add explicit mention of the need
for the AT clause in threaded ECPG applications.

Philip Yarra
2003-12-01 22:36:40 +00:00
Bruce Momjian 8c4af96fb0 This makes help like this:
\lo_export LOBOID FILE
   \lo_import FILE [COMMENT]
   \lo_list
   \lo_unlink LOBOID    large object operations

Instead of not saying anything about what arguments are required.

Christopher Kings-Lynne
2003-12-01 22:34:48 +00:00
Bruce Momjian c217b36e17 Win32 patch for Makefile.shlib
Claudio Natoli
2003-12-01 22:23:06 +00:00
Bruce Momjian 9be15f4d52 Update for patches applied:
< * Change factorial to return a numeric
> * -Change factorial to return a numeric (Gavin)
258c258
< * Allow psql \du to show groups, and add \dg for groups
> * -Allow psql \du to show groups, and add \dg for groups
2003-12-01 22:22:44 +00:00
Bruce Momjian 8bb60b6423 attached is a patch that adds display of the groups a user belongs to to
\du and a \dg command to psql. It's against 7.4beta5.

Markus Bertheau <twanger@bluetwanger.de>
2003-12-01 22:21:54 +00:00
Tom Lane 5e2b99db95 Avoid assuming that type key_t is 32 bits, since it reportedly isn't
on 64-bit Solaris.  Use a non-system-dependent datatype for UsedShmemSegID,
namely unsigned long (which we were already assuming could hold a shmem
key anyway, cf RecordSharedMemoryInLockFile).
2003-12-01 22:15:38 +00:00
Bruce Momjian 35ddc2edee This patch reduces some unsightly #ifdefs, and fixes two typos in
comments in the psql code. This doesn't make any functional change, so
feel free to save it for 7.5

Neil Conway
2003-12-01 22:14:40 +00:00
Bruce Momjian abd5d75c4c This patch finishes off the work that I did with making view
definitions use pretty printing.

It does:

* Pretty index predicates
* Pretty rule definitions
* Uppercases PRIMARY KEY and UNIQUE to be consistent with CHECK and
FOREIGN KEY
* View rules are improved to match table rules:


Christopher Kings-Lynne
2003-12-01 22:11:06 +00:00
Bruce Momjian 7ce9b7c0d8 This patch adds a new GUC var, "default_with_oids", which follows the
proposal for eventually deprecating OIDs on user tables that I posted
earlier to pgsql-hackers. pg_dump now always specifies WITH OIDS or
WITHOUT OIDS when dumping a table. The documentation has been updated.

Neil Conway
2003-12-01 22:08:02 +00:00
Bruce Momjian e7ca867485 Try to reduce confusion about what is a lock method identifier, a lock
method control structure, or a table of control structures.

. Use type LOCKMASK where an int is not a counter.

. Get rid of INVALID_TABLEID, use INVALID_LOCKMETHOD instead.

. Use INVALID_LOCKMETHOD instead of (LOCKMETHOD) NULL, because
  LOCKMETHOD is not a pointer.

. Define and use macro LockMethodIsValid.

. Rename LOCKMETHOD to LOCKMETHODID.

. Remove global variable LongTermTableId in lmgr.c, because it is
  never used.

. Make LockTableId static in lmgr.c, because it is used nowhere else.
  Why not remove it and use DEFAULT_LOCKMETHOD?

. Rename the lock method control structure from LOCKMETHODTABLE to
  LockMethodData.  Introduce a pointer type named LockMethod.

. Remove elog(FATAL) after InitLockTable() call in
  CreateSharedMemoryAndSemaphores(), because if something goes wrong,
  there is elog(FATAL) in LockMethodTableInit(), and if this doesn't
  help, an elog(ERROR) in InitLockTable() is promoted to FATAL.

. Make InitLockTable() void, because its only caller does not use its
  return value any more.

. Rename variables in lock.c to avoid statements like
        LockMethodTable[NumLockMethods] = lockMethodTable;
        lockMethodTable = LockMethodTable[lockmethod];

. Change LOCKMETHODID type to uint16 to fit into struct LOCKTAG.

. Remove static variables BITS_OFF and BITS_ON from lock.c, because
  I agree to this doubt:
 * XXX is a fetch from a static array really faster than a shift?

. Define and use macros LOCKBIT_ON/OFF.


Manfred Koizar
2003-12-01 21:59:25 +00:00
Bruce Momjian e2ac58c7bd Remove mention of factorial as casting example. New example needed. 2003-12-01 21:53:15 +00:00
Bruce Momjian 04a4821ade Attached is a patch implementing factorial(), returning numeric. Points
to note:

1) arttype is numeric. I thought this was the best way of allowing
arbitarily large factorials, even though factorial(2^63) is a large
number. Happy to change to integers if this is overkill.
2) since we're accepting numeric arguments, the patch tests for floats.
If a numeric is passed with non-zero decimal portion, an error is raised
since (from memory) they are undefined.

Gavin Sherry
2003-12-01 21:52:38 +00:00
Tom Lane af03663878 Minor wordsmithing in datetime docs to try to address gripes raised by
cnliou.
2003-12-01 20:34:53 +00:00
Tom Lane c5336a892f netmask() and hostmask() functions should return maximum-length masklen,
per gripe from Joe Sunday.
2003-12-01 18:50:19 +00:00
Tom Lane 3e5da0a8da Fix typos noted by Halley Pacheco de Oliveira. 2003-12-01 17:58:27 +00:00
Tom Lane 0902ece5b9 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.
2003-12-01 16:53:19 +00:00