Commit graph

19815 commits

Author SHA1 Message Date
Tom Lane
faefc812f8 Adjust string comparison so that only bitwise-equal strings are considered
equal: if strcoll claims two strings are equal, check it with strcmp, and
sort according to strcmp if not identical.  This fixes inconsistent
behavior under glibc's hu_HU locale, and probably under some other locales
as well.  Also, take advantage of the now-well-defined behavior to speed up
texteq, textne, bpchareq, bpcharne: they may as well just do a bitwise
comparison and not bother with strcoll at all.

NOTE: affected databases may need to REINDEX indexes on text columns to be
sure they are self-consistent.
2005-12-22 22:50:14 +00:00
Teodor Sigaev
ba6e1b2e72 Fix word's length in pg_regexec call 2005-12-21 13:08:14 +00:00
Tom Lane
1200fc58a7 Defend against crash while processing Describe Statement or Describe Portal
messages, when client attempts to execute these outside a transaction (start
one) or in a failed transaction (reject message, except for COMMIT/ROLLBACK
statements which we can handle).  Per report from Francisco Figueiredo Jr.
2005-12-14 17:06:51 +00:00
Tom Lane
ec8c876bde Fix a *different* problem with whole-row Vars afflicting 8.0 branch.
This is a back-port of a fix made to markTargetListOrigin() on 2005-04-25.
2005-12-14 16:30:20 +00:00
Peter Eisentraut
4138c3833d Translation updates 2005-12-09 22:16:16 +00:00
Tom Lane
499dad06f2 Stamp 8.0.5. 2005-12-09 20:49:38 +00:00
Tom Lane
9e127658f2 Add release notes for back branches (7.3 and up).
Also minor improvements to 8.1.1 release notes.
2005-12-09 20:40:38 +00:00
Peter Eisentraut
bd760bf800 Documentation fix: s/event_object_name/event_object_table/g 2005-12-08 20:45:26 +00:00
Tom Lane
929f852287 Fix bgwriter's failure to release buffer pins and open files after an
error.  This probably explains bug #2099 and could also account for
mysterious VACUUM hangups.
2005-12-08 19:19:45 +00:00
Teodor Sigaev
9a40b555d3 Fix stupid bug with sizeof 2005-12-06 18:22:21 +00:00
Tom Lane
7563a16b11 In a nestloop inner indexscan, it's OK to use pushed-down baserestrictinfo
clauses even if it's an outer join.  This is a corner case since such
clauses could only arise from weird OUTER JOIN ON conditions, but worth
fixing.  Per example from Ron at cheapcomplexdevices.com.
2005-12-06 16:50:55 +00:00
Tom Lane
81788719b9 Add regression test to see if the min/max values of int8 convert correctly. 2005-12-05 04:14:07 +00:00
Tom Lane
91ab1fefbd Fix out-of-order inclusion of -L switches from LDFLAGS on AIX and HPUX.
Per example from Dirk Pirschel.
2005-12-03 20:16:50 +00:00
Tom Lane
b0be56634b Fix obsolete description of -h option, per Andreas Schmidt. 2005-12-02 23:14:02 +00:00
Tom Lane
eeae797d33 Retry in FileRead and FileWrite if Windows returns ERROR_NO_SYSTEM_RESOURCES.
Also add a retry for Unixen returning EINTR, which hasn't been reported
as an issue but at least theoretically could be.  Patch by Qingqing Zhou,
some minor adjustments by me.
2005-12-01 20:24:49 +00:00
Tom Lane
64c09adea7 Check for overflow in strtol() while parsing datetime inputs.
Michael Fuhr.
2005-12-01 17:56:54 +00:00
Tom Lane
a4a51d58e8 Rearrange code in pg_atoi() to avoid assuming that isspace() cannot
change errno.  No reported bugs here, but why take a chance?
2005-11-30 23:10:34 +00:00
Michael Meskes
f9bdaeeb34 - Made several variables "const char *" instead of "char *" as proposed by Qingqing Zhou <zhouqq@cs.toronto.edu>.
- Replaced all strdup() calls by ECPGstrdup().
2005-11-30 12:51:07 +00:00
Tom Lane
acd3a4f3c5 Fix performance issue in exprTypmod(): for a COALESCE expression, it
recursed twice on its first argument, leading to exponential time spent
on a deep nest of COALESCEs ... such as a deeply nested FULL JOIN would
produce.  Per report from Matt Carter.
2005-11-18 23:08:28 +00:00
Bruce Momjian
f583cbc8a0 Properly document return value of strpos(). 2005-11-16 03:56:08 +00:00
Bruce Momjian
a99f293753 Update error message and documentation for fsync test. 2005-11-16 03:44:51 +00:00
Bruce Momjian
4bc4ce01a7 Update test_fsync to honor -f.
Backpatch to 8.0.X.
2005-11-16 01:34:11 +00:00
Tom Lane
c7d40ff35f Force the second argument of SUBSTRING(foo FOR bar) to be int4, to avoid
surprising results when it's some other numeric type.  This doesn't solve
the generic problem of surprising implicit casts to text, but it's a
low-impact way of making sure this particular case behaves sanely.
Per gripe from Harald Fuchs and subsequent discussion.
2005-11-13 19:12:05 +00:00
Tom Lane
55b5a42b6a When in transaction-aborted state, reject Bind message for portals containing
anything but transaction-exiting commands (ROLLBACK etc).  We already rejected
Parse and Execute in such cases, so there seems little point in allowing Bind.
This prevents at least an Assert failure, and probably worse things, since
there's a lot of infrastructure that doesn't work when not in a live
transaction.  We can also simplify the Bind logic a bit by rejecting messages
with a nonzero number of parameters, instead of the former kluge to silently
substitute NULL for each parameter.  Per bug #2033 from Joel Stevenson.
2005-11-10 00:31:49 +00:00
Tom Lane
d70d39fbbb Fix misspelling of 'listen_addresses', per Devrim. 2005-11-09 17:44:22 +00:00
Tom Lane
39edcf59a2 Repair an error introduced by log_line_prefix patch: it is not acceptable
to assume that the string pointer passed to set_ps_display is good forever.
There's no need to anyway since ps_status.c itself saves the string, and
we already had an API (get_ps_display) to return it.
I believe this explains Jim Nasby's report of intermittent crashes in
elog.c when %i format code is in use in log_line_prefix.
While at it, repair a previously unnoticed problem: on some platforms such as
Darwin, the string returned by get_ps_display was blank-padded to the maximum
length, meaning that lock.c's attempt to append " waiting" to it never worked.
2005-11-05 03:05:05 +00:00
Bruce Momjian
56f68ed907 Backpatch FAQ's for 8.0.X. 2005-11-05 01:36:42 +00:00
Tom Lane
6d8476ab3b Ensure that we only create one ConsoleCtrlHandler per psql process,
so as to avoid performance issues and possible ultimate crash on long
psql scripts.  Per Merlin Moncure.
2005-11-04 18:35:51 +00:00
Teodor Sigaev
0c1a3f94c6 Fix incorrect header size macros 2005-11-03 18:15:47 +00:00
Tom Lane
09048b95e7 Fix longstanding race condition in transaction log management: there was a
very narrow window in which SimpleLruReadPage or SimpleLruWritePage could
think that I/O was needed when it wasn't (and indeed the buffer had already
been assigned to another page).  This would result in an Assert failure if
Asserts were enabled, and probably in silent data corruption if not.
Reported independently by Jim Nasby and Robert Creager.

I intend a more extensive fix when 8.2 development starts, but this is a
reasonably low-impact patch for the existing branches.
2005-11-03 00:23:43 +00:00
Andrew Dunstan
0622b1d738 Provide a --no-locale option for pg_regress and a corresponding NOLOCALE=1
setting for the regression makefile, allowing Windows users to force locale
settings since Windows does not get its locale from the environment.

Per Petr Jelinek.
2005-11-01 15:32:52 +00:00
Bruce Momjian
c3d56155d4 Properly update the 'group' flatfile when modifying the user, in case
they were added to a group.  Also fix visibility of our own changes when
creating the group file.  This fixes:

        test=> CREATE GROUP g1;
        CREATE GROUP

        test=> CREATE USER u1 IN GROUP g1;
        CREATE USER
        test=> \! cat /u/pg/data/global/pg_group
        "g1"    "u1"

        test=> CREATE USER u2 IN GROUP g1;
        CREATE USER
        test=> \! cat /u/pg/data/global/pg_group
        "g1"    "u1" "u2"

        test=> ALTER USER u2 RENAME TO u3;
        ALTER USER
        test=> \! cat /u/pg/data/global/pg_group
        "g1"    "u1" "u3"

[ this code does not exist in CVS head.]

Per report from Dennis Vshivkov
2005-10-26 13:43:28 +00:00
Bruce Momjian
8f03406ee9 Update AIX FAQ, backpatch. 2005-10-26 13:20:47 +00:00
Tom Lane
15b46f121f Fix longstanding bug that would sometimes let the planner generate a bad plan
for an outer join; symptom is bogus error "RIGHT JOIN is only supported with
merge-joinable join conditions".  Problem was that select_mergejoin_clauses
did its tests in the wrong order.  We need to force left join not right join
for a merge join when there are non-mergeable join clauses; but the test for
this only accounted for mergejoinability of the clause operator, and not
whether the left and right Vars were of the proper relations.  Per report
from Jean-Pierre Pelletier.
2005-10-25 20:30:35 +00:00
Tom Lane
ea19eb999d Postpone pg_timezone_initialize() until after creation of postmaster.pid,
since it can take a fair amount of time and this can confuse boot scripts
that expect postmaster.pid to appear quickly.  Move initialization of SSL
library and preloaded libraries to after that point, too, just for luck.
Per reports from Tony Caduto and others.
2005-10-20 20:06:03 +00:00
Tom Lane
09290098c5 Prevent core dump in contrib version of autovacuum when a table has been
dropped.  Per report from daveg (not his patch, though).
2005-10-20 16:14:39 +00:00
Tom Lane
fd5efffc15 Back-patch fix for proper labeling of whole-row Datums generated from
subquery results.
2005-10-19 22:51:26 +00:00
Tom Lane
98658dd404 Pass a strdup'd ident string to openlog(), to ensure that reallocation
of GUC memory doesn't cause us to start emitting a bogus ident string.
Per report from Han Holl.  Also some trivial code cleanup in write_syslog.
2005-10-14 16:41:13 +00:00
Bruce Momjian
7df6dfdda7 [ Backpatch to 8.0.X.]
Also I fixed a bug in a bug fix I committed a few weeks ago. he check
for a varchar pointer was incomplete.

Michael Meskes
2005-10-14 01:50:23 +00:00
Tom Lane
00de66a3b4 Fix longstanding bug found by Atsushi Ogawa: _bt_check_unique would mark
the wrong buffer dirty when trying to kill a dead index entry that's on
a page after the one it started on.  No risk of data corruption, just
inefficiency, but still a bug.
2005-10-12 17:18:15 +00:00
Neil Conway
592ca3cf06 Fix typo in sample pg_hba.conf; per IRC report from Bernhard Neuhauser. 2005-10-11 22:59:11 +00:00
Tom Lane
d30c134806 Fix oversight in 8.0 modification of RestrictInfo data structures.
A RestrictInfo representing an OR clause now contains two versions of
the contained expression, one with sub-RestrictInfos and one without.
clause_selectivity() should descend to the version with sub-RestrictInfos
so that it has a chance of caching its results for the OR's sub-clauses.
Failing to do so resulted in redundant planner effort.
2005-10-11 16:45:00 +00:00
Neil Conway
20f5a328e5 Backpatch merge_db() example for PL/PgSQL to 8.0. Patch from David
Fetter, fixes by Neil Conway.
2005-10-06 21:21:27 +00:00
Bruce Momjian
ce150c4a8b Update Japanese FAQ.
Jun Kuwamura
2005-10-05 11:51:27 +00:00
Bruce Momjian
b0db380b09 Update version number in faq. 2005-10-05 11:27:10 +00:00
Bruce Momjian
2a3f44b769 Update FAQ's in 8.0.X branch. (very small changes) 2005-10-04 14:18:43 +00:00
Bruce Momjian
610a7c6fdc Add FAQ_hungarian.html to 8.0.X branch. 2005-10-04 14:17:44 +00:00
Tom Lane
3dfec7f73e COPY's test for read-only transaction was backward; it prohibited COPY TO
where it should prohibit COPY FROM.  Found by Alon Goldshuv.
2005-10-03 23:43:29 +00:00
Tom Lane
73a71f50cd Stamp release 8.0.4. 2005-10-03 17:07:18 +00:00
Tom Lane
65ae842791 Update release notes for pending back-branch releases. 2005-10-03 16:04:51 +00:00