Commit Graph

25150 Commits

Author SHA1 Message Date
Tom Lane d514ea3fda Fix an old thinko in SS_make_initplan_from_plan, which is used when optimizing
a MIN or MAX aggregate call into an indexscan: the initplan is being made at
the current query nesting level and so we shouldn't increment query_level.
Though usually harmless, this mistake could lead to bogus "plan should not
reference subplan's variable" failures on complex queries.  Per bug report
from David Sanchez i Gregori.
2007-07-18 21:40:57 +00:00
Alvaro Herrera cdedfe6af1 Cast NULL to a pointer type in the execl() call, to avoid a compiler warning on
some platforms and possibly a bug.  Per report from Stefan and subsequent
discussion.
2007-07-18 21:19:17 +00:00
Magnus Hagander dc32d2cefa GSSAPI documentation 2007-07-18 12:00:47 +00:00
Bruce Momjian 9e19063abc Document that 'deleted' is also tracked by autovacuum. 2007-07-18 03:39:01 +00:00
Bruce Momjian b6ed78b2bd Properly adjust age() seconds to match the sign of the larger units.
Patch from Tom.
2007-07-18 03:13:13 +00:00
Bruce Momjian df7128bd34 Document that age() adds days, then full months. 2007-07-18 03:12:42 +00:00
Bruce Momjian 27d074923d Add:
>
> 	o Allow GLOBAL temporary tables to exist as empty by default in
> 	  all sessions
>
> 	  http://archives.postgresql.org/pgsql-hackers/2007-07/msg00006.php
>
2007-07-18 00:16:21 +00:00
Tom Lane 2c535bfe81 Fix incorrect optimization of foreign-key checks. When an UPDATE on the
referencing table does not change the tuple's FK column(s), we don't bother
to check the PK table since the constraint was presumably already valid.
However, the check is still necessary if the tuple was inserted by our own
transaction, since in that case the INSERT trigger will conclude it need not
make the check (since its version of the tuple has been deleted).  We got this
right for simple cases, but not when the insert and update are in different
subtransactions of the current top-level transaction; in such cases the FK
check would never be made at all.  (Hence, problem dates back to 8.0 when
subtransactions were added --- it's actually the subtransaction version of a
bug fixed in 7.3.5.)  Fix, and add regression test cases.  Report and fix by
Affan Salman.
2007-07-17 17:45:28 +00:00
Bruce Momjian a5ca334a21 Remove http://www.benchmarkresources.com, no longer resolves to a
meaningful site.
2007-07-17 05:03:55 +00:00
Neil Conway 474774918b Implement CREATE TABLE LIKE ... INCLUDING INDEXES. Patch from NikhilS,
based in part on an earlier patch from Trevor Hardcastle, and reviewed
by myself.
2007-07-17 05:02:03 +00:00
Bruce Momjian 77d27e43e5 Add CVS Wiki URL to docs. 2007-07-17 01:52:34 +00:00
Tom Lane 804f016fb5 Fix outfuncs.c to dump A_Const nodes representing NULLs correctly. This has
been broken since forever, but was not noticed because people seldom look
at raw parse trees.  AFAIK, no impact on users except that debug_print_parse
might fail; but patch it all the way back anyway.  Per report from Jeff Ross.
2007-07-17 01:21:43 +00:00
Bruce Momjian 74fbe9ccd1 Add:
> * Allow multiple indexes to be created concurrently, ideally via a
>   single heap scan, and have a restore of a pg_dump somehow use it
>
>   http://archives.postgresql.org/pgsql-general/2007-05/msg01274.php

Small blank line additions.
2007-07-17 00:07:54 +00:00
Bruce Momjian 5fb01d829a Update docs that GNU tar versions >=1.16 exit with 1 on files changed, 2
on other errors.
2007-07-16 22:20:51 +00:00
Tom Lane 2a275e6d3c Fix pg_buffercache to release buffer partition locks in reverse order,
and add a note about why.  This is not tremendously important right now,
probably, but it will get more urgent if NUM_BUFFER_PARTITIONS is increased
as much as proposed.
2007-07-16 21:20:36 +00:00
Tom Lane 82b3684672 Add comments spelling out why it's a good idea to release multiple
partition locks in reverse order.
2007-07-16 21:09:50 +00:00
Neil Conway e9e97500c9 With the native compiler on Unixware, disable optimization if
--enable-debug is used, to avoid complaints about debugging and
optimization being mutually exclusive. Patch from Stefan Kaltenbrunner.
2007-07-16 17:38:48 +00:00
Tom Lane ae1b7e298c Allow plpgsql function parameter names to be qualified with the function's
name.  With this patch, it is always possible for the user to qualify a
plpgsql variable name if needed to avoid ambiguity.  While there is much more
work to be done in this area, this simple change removes one unnecessary
incompatibility with Oracle.  Per discussion.
2007-07-16 17:01:11 +00:00
Tom Lane 9f6f51d5d4 Hmm, so evidently _check_lock and _clear_lock take an argument of type
int not unsigned int.  Third try to get grebe building without warnings...
2007-07-16 14:02:22 +00:00
Magnus Hagander bbef913250 Quote pathnames so pg_standby works with paths that have
spaces in them.

ISHIDA Akio
2007-07-16 08:40:52 +00:00
Tom Lane 5aaf09ac46 So our reward for including <sys/atomic_op.h> seems to be a bunch of
nattering about casting away volatile.  Losers.
2007-07-16 04:57:57 +00:00
Tom Lane 057d5c421f On AIX, include <sys/atomic_op.h> so that the functions we use for
TAS support are properly declared.
2007-07-16 02:03:14 +00:00
Tom Lane 37e347a7e0 Get rid of overly cute, unportable, probably not very efficient substitute
for 'bool'.  Per buildfarm warnings.
2007-07-15 23:57:13 +00:00
Tom Lane 93624bcda0 Fix CHECK_RELATION_BLOCK_RANGE macro, which was not merely producing
a warning but was outright wrong.
2007-07-15 23:46:20 +00:00
Tom Lane 4608f359a6 Fix a passel of signed vs unsigned char warnings. 2007-07-15 23:30:19 +00:00
Tom Lane cfd6c89b04 Silence a rather odd compiler warning. In passing, make this file's
error messages look at least a little bit like the message style
guidelines say.
2007-07-15 23:09:26 +00:00
Tom Lane a190eb3d7d Avoid possibly-unportable initializer, per buildfarm warning. 2007-07-15 22:57:48 +00:00
Tom Lane 84a0445c4d Change a couple of exit(0) to return 0 to suppress complaints from
not-too-bright compilers.  Per buildfarm results.
2007-07-15 22:54:21 +00:00
Tom Lane 7176e60bc8 Silence Solaris compiler warnings, per buildfarm. 2007-07-15 22:49:36 +00:00
Tom Lane 10a91e0add Silence Solaris compiler warning, per buildfarm. 2007-07-15 22:43:40 +00:00
Tom Lane af18d3d05c Fix compile warning on Solaris, per buildfarm. (Why have we got
three slightly different copies of this file?)
2007-07-15 22:40:28 +00:00
Tom Lane cd54eb2b5b Fix possible portability problem, per buildfarm warnings. 2007-07-15 22:34:26 +00:00
Tom Lane c11b8dcdbb Fix unportable use of isspace(), per buildfarm results. 2007-07-15 22:32:53 +00:00
Tom Lane 78c84ad49e Because plpgsql's scanner uses %option case-insensitive, flex's results could
theoretically vary depending on what the compile-time locale setting is.
Hence, force it to see LC_CTYPE=C to ensure consistent build results.
(It's likely that this makes no difference in practice, since our
specification for "identifier" surely includes both ends of any possible
uppercase/lowercase pair anyway.  But it should silence warnings about
ambiguous character classes that are reported by some buildfarm members.)
2007-07-15 22:18:24 +00:00
Tom Lane 816ff27f60 Reject zero or negative BY step in plpgsql integer FOR-loops, and behave
sanely if the loop value overflows int32 on the way to the end value.
Avoid useless computation of "SELECT 1" when BY is omitted.  Avoid some
type-punning between Datum and int4 that dates from the original coding.
2007-07-15 02:15:04 +00:00
Tom Lane a69f9028b5 Note incompatibility with Oracle's version of FOR ... REVERSE, per
Andrew Dunstan.  Minor other improvements in documentation of integer
FOR loops.
2007-07-15 00:45:16 +00:00
Tom Lane d849c5d182 Editorial overhaul of plpgsql documentation. Provide detailed documentation
of variable substitution and plan caching behavior in dedicated sections.
(A lot of this material existed already, but was scattered in various places
in the chapter.)  Reorganize material a little bit, mostly to try to avoid
diving into deep details in the first introductory sections.  Document some
fine points that had escaped treatment before, notably the ability to qualify
plpgsql variable names with block labels.  Some minor wordsmithing here and
there.
2007-07-14 23:02:25 +00:00
Magnus Hagander 3787797f72 Support for finding gssapi functions in the library "gss", as required
by Solaris 10 and possibly others.

Stefan Kaltenbrunner
2007-07-14 11:13:28 +00:00
Tom Lane 2789b7278c Volatile-qualify a dozen variables in plpython.c to eliminate warnings
from old versions of gcc.  It's not clear to me that this is really
necessary for correctness, but less warnings are always good.
Per buildfarm results and local testing.
2007-07-13 04:57:59 +00:00
Tom Lane 39f06dcad6 Fix map_sql_typecoll_to_xmlschema_types() to not fail on dropped
columns, per my gripe earlier today.  Make it look a bit less like
someone's first effort at backend coding.
2007-07-13 03:43:23 +00:00
Tom Lane a702159158 Add casts to suppress warnings about m68k-specific kluge in fmgr.c. 2007-07-13 02:25:48 +00:00
Tom Lane 04b54876b6 Fix a portability bug (ye olde not casting a <ctype.h> argument to
unsigned char).  Fortunately we still have buildfarm machines that
will flag this.  Seems to be new in CVS HEAD, so no backpatch.
2007-07-12 23:51:10 +00:00
Tom Lane 6bc12a4aca Get dirmod.c on the same page as port.h about whether we use pgsymlink
on Cygwin (answer: we don't).  Also try to unwind the #ifdef spaghetti
a little bit.  Untested but hopefully I didn't break anything.
2007-07-12 23:28:49 +00:00
Neil Conway ad44c95825 Fixup the indentation of a comment that was mangled by pgindent, and
add dashes to the start/end of the comment block to try to prevent
this happening in the future.
2007-07-12 23:25:26 +00:00
Tom Lane 4f09b55dc3 Simplify overly-cute array coding to avoid an apparent gcc bug, which
may or may not be harmless.  Report from Stefan, patch from Heikki.
2007-07-12 23:10:57 +00:00
Tom Lane 4bbb7f9469 Suppress Sun Studio warnings, per Stefan. 2007-07-12 21:27:09 +00:00
Tom Lane 4dbbef2845 Suppress an integer-overflow warning. 2007-07-12 21:17:09 +00:00
Tom Lane 292e4c6190 Some of our port-specific dynloader implementations are careful to
define pg_dlsym() as returning a PGFunction pointer, not just any
pointer-to-function.  But many are not.  Suppress compiler warnings
on platforms that aren't careful by inserting explicit casts at the
two call sites that didn't have a cast already.  Per Stefan.
2007-07-12 21:13:27 +00:00
Tom Lane 706754c16b Compute max and min int8 values using unsigned arithmetic, in hopes of
suppressing Sun Studio compiler warnings.  Per Stefan.
2007-07-12 21:04:45 +00:00
Tom Lane 72c7badbab Fix some warnings (probably actual bugs) generated by new GSSAPI code
when built on a 64-bit machine.  Per buildfarm results extracted by Stefan.
2007-07-12 20:36:11 +00:00