Commit Graph

28558 Commits

Author SHA1 Message Date
Tom Lane dcc9d37331 Make the configure messages rejecting old bison and flex versions include
the full path and version of the program being rejected.
2009-07-13 05:36:53 +00:00
Tom Lane 34a11144e5 Although the flex documentation avers that yyalloc and yyrealloc take
size_t arguments, the emitted scanner actually prototypes them with
type yy_size_t, which is sometimes not the same thing depending on
flex version and platform.  Easiest fix seems to be to use yy_size_t.
Per buildfarm results.
2009-07-13 03:11:12 +00:00
Tom Lane 91e71929ba Convert the core lexer and parser into fully reentrant code, by making use
of features added to flex and bison since this code was originally written.
This change doesn't in itself offer any new capability, but it's needed
infrastructure for planned improvements in plpgsql.

Another feature now available in flex is the ability to make it use palloc
instead of malloc, so do that to avoid possible memory leaks.  (We should
at some point change the other lexers likewise, but this commit doesn't
touch them.)
2009-07-13 02:02:20 +00:00
Tom Lane da4b900176 Advance the minimum required version of "flex" from 2.5.4 to 2.5.31, and
update documentation accordingly.  This is required in order to have support
for a reentrant scanner.  I'm committing this bit separately in order to have
an easy reference if we later decide to make the minimum something different
(like 2.5.33).
2009-07-13 01:51:56 +00:00
Bruce Momjian 4bd556b193 Stamp minor library version numbers for 8.5; sorry for the delay. 2009-07-13 01:37:05 +00:00
Tom Lane f1d9c299d6 Fix up PGDLLIMPORT marking for standard_conforming_strings. Moving it
into a header file that plpgsql's scan.l can see broke the previous
kluge.  Per buildfarm results.
2009-07-13 00:42:18 +00:00
Tom Lane 6566e37e02 Move some declarations in the raw-parser header files to create a clearer
distinction between the external API (parser.h) and declarations that only
need to be visible within the raw parser code (gramparse.h, which now is only
included by parser.c, gram.y, scan.l, and keywords.c).  This is in preparation
for the upcoming change to a reentrant lexer, which will require referencing
YYSTYPE in the declarations of base_yylex and filtered_base_yylex, hence
gram.h will have to be included by gramparse.h.  We don't want any more files
than absolutely necessary to depend on gram.h, so some cleanup is called for.
2009-07-12 17:12:34 +00:00
Peter Eisentraut 23d830bd9a Alter some gratuitous uses of "ANSI" when "SQL standard" might have been
meant or the reference to a standard was unnecessary.
2009-07-11 21:15:32 +00:00
Peter Eisentraut c95db342e7 Correct what ISO stands for 2009-07-11 21:13:21 +00:00
Tom Lane 014be15047 Fix set_rel_width() to do something reasonable with non-Var items in a
RelOptInfo targetlist.  It used to be that the only possibility other than
a Var was a RowExpr representing a whole-row child Var, but as of 8.4's
expanded ability to flatten appendrel members, we can get arbitrary expressions
in there.  Use the expression's type info and get_typavgwidth() to produce
an at-least-marginally-sane result.  Note that get_typavgwidth()'s fallback
estimate (32 bytes) is the same as what was here before, so there will be
no behavioral change for RowExprs.  Noted while looking at recent gripe
about constant quals pushed down to FunctionScan appendrel members ...
not only were we failing to recognize the constant qual, we were getting
the width estimate wrong :-(
2009-07-11 04:09:33 +00:00
Tom Lane e7370babd1 Fix xslt_process() to ensure that it inserts a NULL terminator after the
last pair of parameter name/value strings, even when there are MAXPARAMS
of them.  Aboriginal bug in contrib/xml2, noted while studying bug #4912
(though I'm not sure whether there's something else involved in that
report).

This might be thought a security issue, since it's a potential backend
crash; but considering that untrustworthy users shouldn't be allowed
to get their hands on xslt_process() anyway, it's probably not worth
getting excited about.
2009-07-10 00:32:00 +00:00
Tom Lane b11ce5608a Remove no-longer-necessary transmission of postmaster's LC_COLLATE and
LC_CTYPE settings to children via BackendParameters.  Per discussion,
the postmaster is now just using system defaults anyway, so we might as
well save a few cycles during backend startup.
2009-07-08 18:55:35 +00:00
Heikki Linnakangas e5bb0f04db Need to use pg_perm_setlocale when setting LC_CTYPE and LC_COLLATE at startup.
Otherwise, the LC_CTYPE/COLLATE setting gets reverted when using plperl, which
leads to incorrect query results and index corruption.

This was accidentally broken in the per-database locale patch in 8.4. Pointed
out by Andrew Gierth.
2009-07-08 17:53:29 +00:00
Tom Lane 53e7229258 Add missing HOUR TO SECOND option to list of possible INTERVAL field sets,
as noted by Sebastien Flaesch.  Also update the claim that we simply throw
away fields outside this set --- that got changed later to only discard
less-significant fields.
2009-07-08 17:21:55 +00:00
Peter Eisentraut df20667112 When calling unsupported "make check" with a pgxs module, return a nonzero
exit code.
2009-07-08 13:47:29 +00:00
Tom Lane e01d732db3 Just a little more schema-qualification ... 2009-07-07 21:45:05 +00:00
Peter Eisentraut b34f6ab804 psql backward compatibility fix
For servers older than 8.3, sort display of child tables by relname instead
of oid::regclass::text, because the cast from regclass to text did not work
back then.  The older display may be slightly worse when different schemas
are involved, but that should be rare enough.
2009-07-07 20:32:20 +00:00
Tom Lane ba3fb57d81 Don't use 'return' where you should use 'PG_RETURN_xxx'. 2009-07-07 19:28:56 +00:00
Tom Lane fc9dd12da0 Query in SQL function still not schema-safe; add a couple
more pg_catalog. qualifications.
2009-07-07 19:28:00 +00:00
Peter Eisentraut 987281274f Sort child tables by name instead of OID in \d+ display
This was an oversight in the recent patch.  Found by Tom Lane.
2009-07-07 19:05:57 +00:00
Tom Lane 8fe8ac5f40 Fix typo in comment. 2009-07-07 18:49:16 +00:00
Peter Eisentraut e292dbcf54 More sensible character_octet_length
For character types with typmod, character_octet_length columns in the
information schema now show the maximum character length times the
maximum length of a character in the server encoding, instead of some
huge value as before.
2009-07-07 18:23:15 +00:00
Tom Lane 788d8e5139 Code review for patch to show definition of index columns in \d on index.
Safely schema-qualify the pg_get_indexdef call, make the query a bit
prettier in -E mode, remove useless join to pg_index, make it more obvious
that the header[] array is not overrun.
2009-07-07 16:28:38 +00:00
Tom Lane 47386fed46 Use floor() not rint() when reducing precision of fractional seconds in
timestamp_trunc, timestamptz_trunc, and interval_trunc().  This change
only affects the float-datetime case; the integer-datetime case already
behaved like truncation instead of rounding.  Per gripe from Mario Splivalo.

This is a pre-existing issue but I'm choosing not to backpatch, because
it's such a corner case and there have not been prior complaints.  The
issue is largely moot anyway given the trend towards integer datetimes.
2009-07-06 20:29:23 +00:00
Heikki Linnakangas 44886bd878 Fix ancient bug in handling of to_char modifier 'TH', when used with HH.
In what seems like an oversight, we used to treat 'TH' the same as lowercase
'th', but only with HH/HH12.
2009-07-06 19:11:39 +00:00
Tom Lane 9b27eab71c Fix set_append_rel_pathlist() to deal intelligently with cases where
substituting a child rel's output expressions into the appendrel's restriction
clauses yields a pseudoconstant restriction.  We might be able to skip scanning
that child rel entirely (if we get constant FALSE), or generate a one-time
filter.  8.3 more or less accidentally generated plans that weren't completely
stupid in these cases, but that was only because an extra recursive level of
subquery_planner() always occurred and allowed const-simplification to happen.
8.4's ability to pull up appendrel members with non-Var outputs exposes the
fact that we need to work harder here.  Per gripe from Sergey Burladyan.
2009-07-06 18:26:30 +00:00
Peter Eisentraut bf6570abef Show definition of index columns in \d on index
This adds a column called "Definition" to the output of psql \d on an
index, which shows the full expression behind the index column.  For indexes
on plain columns, this is redundant,  but for expression indexes, this
reveals the real expression.

Author: Khee Chin <kheechin@gmail.com>
2009-07-06 17:01:42 +00:00
Tom Lane 869312e65e Per SQL spec (in particular, the grammar in SQL:2008 7.13) we should allow
parentheses around the <query expression body> that follows a WITH clause, eg
	with cte(foo) as ( values(0) ) ((select foo from cte));
This seems to be just an oversight/thinko in gram.y.  Noted while
experimenting with bug #4902.
2009-07-06 02:58:40 +00:00
Tom Lane 9298d2ff39 Fix handling of changed-Param signaling for CteScan plan nodes. We were using
the "cteParam" as a proxy for the possibility that the underlying CTE plan
depends on outer-level variables or Params, but that doesn't work very well
because it sometimes causes calling subqueries to be treated as SubPlans when
they could be InitPlans.  This is inefficient and also causes the outright
failure exhibited in bug #4902.  Instead, leave the cteParam out of it and
copy the underlying CTE plan's extParams directly.  Per bug #4902 from
Marko Tiikkaja.
2009-07-06 02:16:03 +00:00
Peter Eisentraut f39df967e9 Add log_line_prefix placeholder %e to contain the current SQL state
Author: Guillaume Smet <guillaume.smet@gmail.com>
2009-07-03 19:14:25 +00:00
Peter Eisentraut e2b42aef53 Have \d show child tables that inherit from the specified parent
As per discussion, \d shows only the number of child tables, because that
could be hundreds, when used for partitioning.  \d+ shows the actual list.

Author: Damien Clochard <damien@dalibo.info>
2009-07-03 18:56:50 +00:00
Tom Lane 53fa850c80 Fix up pg_dump's --binary-upgrade option so that it behaves properly with
inherited columns and check constraints.  Per my recent trouble report.
2009-07-02 21:34:32 +00:00
Peter Eisentraut 7cc514ac65 Upgrade to Autoconf 2.63
This upgrades the configure infrastructure to the latest Autoconf version.
Some notable news are:
 - The workaround for the broken fseeko() test is gone.
 - Checking for unknown options is now provided by Autoconf itself.
 - Fixes for Mac OS X
2009-07-02 18:55:40 +00:00
Peter Eisentraut 72da68eef0 Regression test for XML mapping functionality
I wrote this one while chasing down some bugs in the closing days of 8.4.  It
could be useful in the long run.  This area of the code had no test coverage
at all before.
2009-07-02 07:03:18 +00:00
Tom Lane 47f6699d00 Remove useless References column for pg_listener catalog description. Per Shigehiro Honda. 2009-07-01 23:57:33 +00:00
Tom Lane f4ab0b032b Stamp HEAD as 8.5devel. 2009-07-01 23:15:55 +00:00
Tom Lane 2c3c2c1c3c Add missed src/include/foreign subdirectory to the set installed into
INSTALLDIR/include/server/.  Itagaki Takahiro
2009-06-30 17:38:50 +00:00
Tom Lane 4d53a2f969 Revert addition of "o" to tar options. This was intended to fix bug #4883,
but the cure appears to be worse than the disease.  It turns out that GNU
tar versions 1.14.x misinterpret -o as --same-owner, not --no-same-owner,
leading to exactly the wrong behavior for both root and nonroot users.
While that bug has been fixed for nearly five years, these tar versions
are still found in the wild, notably in OS X 10.4.  Given that #4883 was
the first complaint we'd heard, it's definitely not worth fixing at the
risk of breaking things for other users.  Perhaps revisit at a later date
when we're not up against a release deadline.
2009-06-27 21:06:46 +00:00
Marc G. Fournier 41f467f343 Bundle v8.4.0 2009-06-27 00:14:47 +00:00
Tom Lane 730e1a9c95 Update release notes in final preparation for 8.4.0. 2009-06-26 22:23:17 +00:00
Tom Lane 9d6469c9b2 Add a note about SystemTap vs DTrace spelling of probe names. 2009-06-26 22:08:17 +00:00
Tom Lane df858fe58a Marginal improvement of description of recovery_end_command. 2009-06-26 22:06:11 +00:00
Tom Lane 2de48a83e6 Cleanup and code review for the patch that made bgwriter active during
archive recovery.  Invent a separate state variable and inquiry function
for XLogInsertAllowed() to clarify some tests and make the management of
writing the end-of-recovery checkpoint less klugy.  Fix several places
that were incorrectly testing InRecovery when they should be looking at
RecoveryInProgress or XLogInsertAllowed (because they will now be executed
in the bgwriter not startup process).  Clarify handling of bad LSNs passed
to XLogFlush during recovery.  Use a spinlock for setting/testing
SharedRecoveryInProgress.  Improve quite a lot of comments.

Heikki and Tom
2009-06-26 20:29:04 +00:00
Peter Eisentraut a6667d96c5 Translation updates for 8.4 release.
File that are translated less than 80% have been removed, as per new
translation team policy.
2009-06-26 19:33:52 +00:00
Peter Eisentraut a87a1e5428 Extract tarballs with "o" option (tar xof), to behave reasonably when run
as root, as would usually be the case during make install.

per bug #4883
2009-06-26 06:40:57 +00:00
Peter Eisentraut 6bcdb8aa85 Use $(TAR) instead of tar in makefiles. 2009-06-26 06:37:14 +00:00
Tom Lane 7a58167ea2 Add __attribute__((format_arg(1))) to the declaration of err_gettext(),
to restore gcc's ability to crosscheck format arguments within elog.c.
Noted in a test compilation with -Wformat-nonliteral enabled.
2009-06-25 23:07:15 +00:00
Heikki Linnakangas 7e48b77b1c Fix some serious bugs in archive recovery, now that bgwriter is active
during it:

When bgwriter is active, the startup process can't perform mdsync() correctly
because it won't see the fsync requests accumulated in bgwriter's private
pendingOpsTable. Therefore make bgwriter responsible for the end-of-recovery
checkpoint as well, when it's active.

When bgwriter is active (= archive recovery), the startup process must not
accumulate fsync requests to its own pendingOpsTable, since bgwriter won't
see them there when it performs restartpoints. Make startup process drop its
pendingOpsTable when bgwriter is launched to avoid that.

Update minimum recovery point one last time when leaving archive recovery.
It won't be updated by the end-of-recovery checkpoint because XLogFlush()
sees us as out of recovery already.

This fixes bug #4879 reported by Fujii Masao.
2009-06-25 21:36:00 +00:00
Peter Eisentraut e6b8f47047 Man pages back to lowercase names, with additional fixup to make the .so
links work.
2009-06-25 21:15:38 +00:00
Tom Lane 888bcdb9e0 Make prior patch pgindent-safe. 2009-06-25 19:33:25 +00:00