Commit Graph

19542 Commits

Author SHA1 Message Date
Tom Lane 82480e28f5 Fix things so that array_agg_finalfn does not modify or free its input
ArrayBuildState, per trouble report from Merlin Moncure.  By adopting
this fix, we are essentially deciding that aggregate final-functions
should not modify their inputs ever.  Adjust documentation and comments
to match that conclusion.
2009-06-20 18:45:28 +00:00
Peter Eisentraut 12bc87e09b Refine the use of terminology around bound and unbound cursors and cursor
variables. Remove the confusing term "reference cursor".
2009-06-18 10:22:09 +00:00
Heikki Linnakangas efa8544fd5 Fix a few errors in comments. Patch by Fujii Masao, plus the one in
visibilitymap.c by me.
2009-06-18 10:08:08 +00:00
Tom Lane f08e5e92e8 Fix the just-reported problem that you can't specify all four trigger event
types in CREATE TRIGGER.  While at it, clean up the amazingly tedious and
inextensible way that the trigger event type list was handled.  Per report
from Greg Sabino Mullane.
2009-06-18 01:27:02 +00:00
Tom Lane e8d78d35f4 ExecAgg() failed to finish running out set-returning functions in the last
aggregated tuple of a run.  Per report from Laurenz Albe.  This is a new
bug in 8.4, but only because prior versions rejected SRFs in an Agg plan
node altogether.
2009-06-17 16:05:34 +00:00
Peter Eisentraut 33d48d975f Fix typo in error message: tgargv -> tg_argv 2009-06-17 13:46:12 +00:00
Tom Lane f51c9a6665 Change test tables in copy2 regression test to be temporary tables.
This prevents autovacuum from reclaiming free space in them and causing
the test's output row order to change, which is causing intermittent
bogus failure reports in the buildfarm.

Backpatch to 8.3.  The issue exists further back, but since autovacuum was
not on by default before 8.3, it's not a problem for buildfarm testing.
2009-06-14 00:00:24 +00:00
Tom Lane 5f6a14077b Fix get_sort_group_operators() so that it doesn't think arrays can be grouped
via hashing.  Eventually we ought to make that possible, but it won't happen
for 8.4.  Per yesterday's report from Robert Haas.
2009-06-13 15:42:09 +00:00
Peter Eisentraut 215ea9b455 Tweak the display of incoming foreign-key constraints in \d, per discussion
on hackers.  Also, take that string out of the translation roster, since
it's now entirely pseudo-SQL.
2009-06-13 13:43:34 +00:00
Tom Lane bfd06a713b Fix several places where a function was declared static and then defined
without static.  Per testing with a compiler that complains about this.
2009-06-12 16:17:29 +00:00
Marc G. Fournier 35daaa91d3 time to tag rc1 ... 2009-06-12 05:19:22 +00:00
Bruce Momjian 838d74d0ce Tighten typedef check for Linux. 2009-06-12 03:09:07 +00:00
Bruce Momjian 1ef4eeef65 Mention BSD/OS find_typedef behavior. 2009-06-12 03:04:48 +00:00
Bruce Momjian 6e8d957d35 Document struct/union problem with pgindent. 2009-06-11 22:21:44 +00:00
Tom Lane 44aa60fa7c Revisit AlterTableCreateToastTable's API once again, hoping to make it what
pg_migrator actually needs and not just a partial solution.  We have to be
able to specify the OID that the new toast table should be created with.
2009-06-11 20:46:11 +00:00
Tom Lane db16e77349 Remove our inadequate kluge that tried to get AIX's various broken versions
of getaddrinfo() to work.  Instead, recommend updating the OS to get a working
version of getaddrinfo.  Per recent discussions.
2009-06-11 19:00:15 +00:00
Tom Lane 4c8175278f Update time zone data files to tzdata release 2009i: DST law changes in
Bangladesh, Egypt, Jordan, Pakistan.
2009-06-11 17:45:38 +00:00
Tom Lane 0c19f05803 Fix things so that you can still do "select foo()" where foo is a SQL
function returning setof record.  This used to work, more or less
accidentally, but I had broken it while extending the code to allow
materialize-mode functions to be called in select lists.  Add a regression
test case so it doesn't get broken again.  Per gripe from Greg Davidson.
2009-06-11 17:25:39 +00:00
Tom Lane 772a074d4a Somebody seems to have thought they could get away without checking for
rsinfo->expectedDesc == NULL in deflist_to_tuplestore(), but that doesn't
look very safe to me.  Noted in passing while studying problem report
from Greg Davidson.
2009-06-11 16:14:18 +00:00
Bruce Momjian d747140279 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list
provided by Andrew.
2009-06-11 14:49:15 +00:00
Bruce Momjian 4e86efb4e5 Add FreeBSD support for find_typedef, per request from Andrew. 2009-06-11 03:14:08 +00:00
Peter Eisentraut 0b7b908882 Translation updates 2009-06-10 23:42:44 +00:00
Peter Eisentraut 0465c52b00 Arrange that the string "syntax error" generated by bison is translated. 2009-06-10 23:11:52 +00:00
Peter Eisentraut 125a5b95d8 Clarify to the translator that plpgsql_yyerror() deals with the translation
of "syntax error", not the literal string.

This same change was made in the backend a while ago; but it applies to
plpgsql as well.
2009-06-10 22:34:11 +00:00
Peter Eisentraut 5e29862aa2 Clarify error message 2009-06-10 21:51:56 +00:00
Peter Eisentraut 746c28a8e4 Improve capitalization and punctuation in recently added GiST message. 2009-06-10 20:02:15 +00:00
Tom Lane 61dd4185ff Keep rs_startblock the same during heap_rescan, so that a rescan of a SeqScan
node starts from the same place as the first scan did.  This avoids surprising
behavior of scrollable and WITH HOLD cursors, as seen in Mark Kirkwood's bug
report of yesterday.

It's not entirely clear whether a rescan should be forced to drop out of the
syncscan mode, but for the moment I left the code behaving the same on that
point.  Any change there would only be a performance and not a correctness
issue, anyway.

Back-patch to 8.3, since the unstable behavior was created by the syncscan
patch.
2009-06-10 18:54:16 +00:00
Tom Lane 2ef8c1acfd Fix cash_in() to behave properly in locales where frac_digits is zero,
eg Japan.  Report and fix by Itagaki Takahiro.  Also fix CASHDEBUG printout
format for branches with 64-bit money type, and some minor comment cleanup.

Back-patch to 7.4, because it's broken all the way back.
2009-06-10 16:31:32 +00:00
Bruce Momjian 09cba66235 Fix Linux typedef code. 2009-06-10 15:13:45 +00:00
Peter Eisentraut 208d3a7555 Correct/improve the datetime_precision field in the information schema.
In particular, always show 0 for the date type instead of null, and show
6 (the default) for time, timestamp, and interval without a declared
precision.  This is now in fuller conformance with the SQL standard.

Also clarify the documentation about this.

discovered and analyzed by Konstantin Izmailov and Tom Lane
2009-06-10 07:03:34 +00:00
Tom Lane 5cca35a68b Make handling of INTERVAL DAY TO MINUTE and INTERVAL DAY TO SECOND input
more consistent with other cases, by having an unlabeled integer field
be treated as a number of minutes or seconds respectively.  These cases
are outside the spec (which insists on full "dd hh:mm" or "dd hh:mm:ss"
input respectively), so it's not much help to us in deciding what to do.
But with this change, it's uniformly the case that an unlabeled integer
will be considered as being a number of the interval's rightmost field.
The change also takes us back to the 8.3 behavior of throwing error
for certain ambiguous inputs such as INTERVAL '1 2' DAY TO MINUTE.
Per recent discussion.
2009-06-10 05:05:03 +00:00
Tom Lane 0dcc73fea4 Ensure xmlFree(NULL) is a no-op instead of a core dump. Per report from
Sergey Burladyan, there are at least some dank corners of libxml2 that
assume this behavior, even though their published documentation suggests
they shouldn't.

This is only really a live problem in 8.3, but the code is still there
for possible debugging use in HEAD, so patch both branches.
2009-06-10 03:44:35 +00:00
Bruce Momjian f371fda397 Fix BSD find_typedef logic. 2009-06-10 03:38:32 +00:00
Bruce Momjian 6c4b3f5f8c Update pgindent instructions. 2009-06-10 01:51:44 +00:00
Bruce Momjian 78f3c3906e Document new location for typedef list. 2009-06-10 01:47:59 +00:00
Peter Eisentraut 9b7304bc25 Fix xmlattribute escaping XML special characters twice (bug #4822).
Author: Itagaki Takahiro <itagaki.takahiro@oss.ntt.co.jp>
2009-06-09 22:00:57 +00:00
Tom Lane e343eaafc2 Mark internal_in as not strict, so that the construct "null::internal"
will throw an error, rather than possibly allowing someone to synthesize
a manual call to an internal-accepting function.  As of CVS HEAD and existing
releases, all such functions are either STRICT or careful about null inputs,
so there is no current security issue here.  But it seems like a good idea
to lock this down to protect against future mistakes.

In passing, similarly lock down trigger_in, language_handler_in, opaque_in,
and shell_in.  These are not believed to present any security risk, but
there's still no good reason to allow nulls of these types to be created.
I left the polymorphic pseudotypes (anyelement etc) alone, since a null
of one of those types doesn't seem to be a problem --- the worst you can
say about it is that it doesn't have an underlying non-polymorphic type.

If we were to make this change during normal development, we'd just
automatically bump catversion for a pg_proc.h change.  But since this doesn't
create a compatibility risk and isn't believed to be fixing a live bug, it
seems better not to force a catversion bump in late beta.
2009-06-09 19:51:00 +00:00
Alvaro Herrera e66576e58c Fix typo, per Tom 2009-06-09 19:36:28 +00:00
Tom Lane 59fb29cac6 Switch order of tests to avoid possible Assert failure for
"array_agg_finalfn(null)".  We should modify pg_proc entries to prevent this
query from being accepted, but let's just make the function itself secure too.
Per my note of today.
2009-06-09 18:15:04 +00:00
Alvaro Herrera e8f28cb25d Dynamically set a lower bound on autovacuum nap time so that we don't rebuild
the database list too often.

Per bug report from Łukasz Jagiełło and ensuing discussion on
pgsql-performance.
2009-06-09 16:41:02 +00:00
Tom Lane adaf60131f Fix failure to double-quote function argument names when needed, in
pg_get_function_arguments() and related functions.  Per report from
Andreas Nolte.
2009-06-09 14:36:06 +00:00
Peter Eisentraut c773ec6b15 Fix map_sql_table_to_xmlschema() with dropped attributes.
also backpatched to 8.3
2009-06-08 21:32:33 +00:00
Tom Lane 32ea236361 Improve the IndexVacuumInfo/IndexBulkDeleteResult API to allow somewhat sane
behavior in cases where we don't know the heap tuple count accurately; in
particular partial vacuum, but this also makes the API a bit more useful
for ANALYZE.  This patch adds "estimated_count" flags to both structs so
that an approximate count can be flagged as such, and adjusts the logic
so that approximate counts are not used for updating pg_class.reltuples.

This fixes my previous complaint that VACUUM was putting ridiculous values
into pg_class.reltuples for indexes.  The actual impact of that bug is
limited, because the planner only pays attention to reltuples for an index
if the index is partial; which probably explains why beta testers hadn't
noticed a degradation in plan quality from it.  But it needs to be fixed.

The whole thing is a bit messy and should be redesigned in future, because
reltuples now has the potential to drift quite far away from reality when
a long period elapses with no non-partial vacuums.  But this is as good as
it's going to get for 8.4.
2009-06-06 22:13:52 +00:00
Tom Lane af98bb2ad7 Move variable declaration to avoid 'unused variable' warning when the
ifdef doesn't trigger.  Not worth back-patching.  Per buildfarm reports.
2009-06-06 03:45:36 +00:00
Tom Lane 356eea24ce Fix a serious bug introduced into GIN in 8.4: now that MergeItemPointers()
is supposed to remove duplicate heap TIDs, we have to be sure to reduce the
tuple size and posting-item count accordingly in addItemPointersToTuple().
Failing to do so resulted in the effective injection of garbage TIDs into the
index contents, ie, whatever happened to be in the memory palloc'd for the
new tuple.  I'm not sure that this fully explains the index corruption
reported by Tatsuo Ishii, but the test case I'm using no longer fails.
2009-06-06 02:39:40 +00:00
Andrew Dunstan 1978d7f13f Adjust recent PERL_SYS_INIT3 call to avoid platforms where it might fail, and to remove compilation warning. Backpatch the release 7.4 2009-06-05 20:32:00 +00:00
Tom Lane 52f0fc703f GIN's ItemPointerIsMin, ItemPointerIsMax, and ItemPointerIsLossyPage macros
should use GinItemPointerGetBlockNumber/GinItemPointerGetOffsetNumber,
not ItemPointerGetBlockNumber/ItemPointerGetOffsetNumber, because the latter
will Assert() on ip_posid == 0, ie a "Min" pointer.  (Thus, ItemPointerIsMin
has never worked at all, but it seems unused at present.)  I'm not certain
that the case can occur in normal functioning, but it's blowing up on me
while investigating Tatsuo-san's data corruption problem.  In any case it
seems like a problem waiting to bite someone.

Back-patch just in case this really is a problem for somebody in the field.
2009-06-05 18:50:47 +00:00
Andrew Dunstan 8b78428fc0 Search for versioned perl library instead of using hardcoded name on Windows. Backpatch to release 8.3 2009-06-05 18:29:56 +00:00
Tom Lane 0d5478196a Trivial code style cleanup around a couple of ngettext calls. 2009-06-04 19:17:39 +00:00
Tom Lane 20d4005c30 Remove a couple of debugging messages that have been #ifdef'd out for ages.
Seems silly to ask translators to expend work on these, especially in
pluralized variants.
2009-06-04 19:16:48 +00:00