1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-28 05:21:27 +03:00

21750 Commits

Author SHA1 Message Date
Tom Lane
b58ed707ce Fix copy-and-pasteo in Russian translation: message complaining about
HAVE_INT64_TIMESTAMP was mentioning PG_CONTROL_VERSION instead.
Victor Snezhko
2006-06-03 16:49:15 +00:00
Tom Lane
7788c43152 PostmasterIsAlive test really ought to be in the inner loop for safety. 2006-05-30 17:08:20 +00:00
Tom Lane
53409f1b37 Remove pqsignalinquire(), which is unused and has portability issues. 2006-05-30 15:58:07 +00:00
Tom Lane
627f25bde3 Update ppport.h to not cause warnings with newest Perl versions.
This is just the minimal necessary change; we might want to adopt
later PPPort output instead.
2006-05-30 15:48:30 +00:00
Bruce Momjian
e82435a96c Move conversion dependency patch to the proper branch, out of 8.1.X,
into HEAD.
2006-05-30 13:36:40 +00:00
Bruce Momjian
7bec90969f Prevent multiple archivers from starting. Backpatch to 8.1.X.
Simon Riggs
2006-05-30 13:31:01 +00:00
Bruce Momjian
f671bee9d0 Re-defines SHA2 symbols so that they would not conflict with certain
versions of OpenSSL.  If your OpenSSL does not contain SHA2, then there
should be no conflict.  But ofcourse, if someone upgrades OpenSSL,
server starts crashing.

Backpatched to 8.1.X.

Marko Kreen
2006-05-30 12:56:56 +00:00
Bruce Momjian
d30da732da Add "inline" compile fix for MSVC/BCC:
#define inline __inline

Backpatch to 8.1.X.

Hiroshi Saito
2006-05-30 12:43:32 +00:00
Bruce Momjian
401ffe0555 Backpatch documentation additions for PL language choice and
regex_replace() to 8.1.X.
2006-05-30 12:32:37 +00:00
Tom Lane
b71b22d901 Fix initdb to properly escape quotes and backslashes in the supplied
superuser password, and also in the paths of the various files it issues
SQL COPY commands for.  Per bug #2424.
2006-05-27 18:07:22 +00:00
Tom Lane
cad1ff1037 Fix pg_restore to process BLOB COMMENT entries correctly; they aren't
really tables and shouldn't get DISABLE TRIGGER processing.  Per bug
#2452 from Robert Treat.
2006-05-24 21:20:24 +00:00
Bruce Momjian
8a507aeaeb Rename in release notes: Mac -> OS/X, Intel to x86:
Fix for OS/X Bonjour on x86 systems (Ashley Clark)
2006-05-23 20:22:02 +00:00
Tom Lane
313a720f95 Stamp release 8.1.4. REL8_1_4 2006-05-21 21:52:58 +00:00
Tom Lane
3f6b5e21c8 Update release notes for upcoming releases. 2006-05-21 21:49:38 +00:00
Tom Lane
dd2a4ce6ac Fix errors in fortuna PRNG reseeding logic that could cause a predictable
session key to be selected by pgp_sym_encrypt() in some cases.  This only
affects non-OpenSSL-using builds.  Marko Kreen
2006-05-21 20:22:23 +00:00
Tom Lane
7f615cab57 Modify libpq's string-escaping routines to be aware of encoding considerations
and standard_conforming_strings.  The encoding changes are needed for proper
escaping in multibyte encodings, as per the SQL-injection vulnerabilities
noted in CVE-2006-2313 and CVE-2006-2314.  Concurrent fixes are being applied
to the server to ensure that it rejects queries that may have been corrupted
by attempted SQL injection, but this merely guarantees that unpatched clients
will fail rather than allow injection.  An actual fix requires changing the
client-side code.  While at it we have also fixed these routines to understand
about standard_conforming_strings, so that the upcoming changeover to SQL-spec
string syntax can be somewhat transparent to client code.

Since the existing API of PQescapeString and PQescapeBytea provides no way to
inform them which settings are in use, these functions are now deprecated in
favor of new functions PQescapeStringConn and PQescapeByteaConn.  The new
functions take the PGconn to which the string will be sent as an additional
parameter, and look inside the connection structure to determine what to do.
So as to provide some functionality for clients using the old functions,
libpq stores the latest encoding and standard_conforming_strings values
received from the backend in static variables, and the old functions consult
these variables.  This will work reliably in clients using only one Postgres
connection at a time, or even multiple connections if they all use the same
encoding and string syntax settings; which should cover many practical
scenarios.

Clients that use homebrew escaping methods, such as PHP's addslashes()
function or even hardwired regexp substitution, will require extra effort
to fix :-(.  It is strongly recommended that such code be replaced by use of
PQescapeStringConn/PQescapeByteaConn if at all feasible.
2006-05-21 20:19:44 +00:00
Tom Lane
3d4dc1acf5 Add a new GUC parameter backslash_quote, which determines whether the SQL
parser will allow "\'" to be used to represent a literal quote mark.  The
"\'" representation has been deprecated for some time in favor of the
SQL-standard representation "''" (two single quote marks), but it has been
used often enough that just disallowing it immediately won't do.  Hence
backslash_quote allows the settings "on", "off", and "safe_encoding",
the last meaning to allow "\'" only if client_encoding is a valid server
encoding.  That is now the default, and the reason is that in encodings
such as SJIS that allow 0x5c (ASCII backslash) to be the last byte of a
multibyte character, accepting "\'" allows SQL-injection attacks as per
CVE-2006-2314 (further details will be published after release).  The
"on" setting is available for backward compatibility, but it must not be
used with clients that are exposed to untrusted input.

Thanks to Akio Ishida and Yasuo Ohgaki for identifying this security issue.
2006-05-21 20:11:02 +00:00
Tom Lane
8fe643b41b Change the backend to reject strings containing invalidly-encoded multibyte
characters in all cases.  Formerly we mostly just threw warnings for invalid
input, and failed to detect it at all if no encoding conversion was required.
The tighter check is needed to defend against SQL-injection attacks as per
CVE-2006-2313 (further details will be published after release).  Embedded
zero (null) bytes will be rejected as well.  The checks are applied during
input to the backend (receipt from client or COPY IN), so it no longer seems
necessary to check in textin() and related routines; any string arriving at
those functions will already have been validated.  Conversion failure
reporting (for characters with no equivalent in the destination encoding)
has been cleaned up and made consistent while at it.

Also, fix a few longstanding errors in little-used encoding conversion
routines: win1251_to_iso, win866_to_iso, euc_tw_to_big5, euc_tw_to_mic,
mic_to_euc_tw were all broken to varying extents.

Patches by Tatsuo Ishii and Tom Lane.  Thanks to Akio Ishida and Yasuo Ohgaki
for identifying the security issues.
2006-05-21 20:05:50 +00:00
Alvaro Herrera
e5ab52b273 Have autovacuum report its activities to the stat collector. 2006-05-19 15:15:38 +00:00
Bruce Momjian
3a3622c5f0 Back out \' change for tsearch2, broke regression tests. 2006-05-19 04:41:06 +00:00
Bruce Momjian
e720382441 Stamp 8.1.4, except configure/configure.in. 2006-05-19 03:57:17 +00:00
Bruce Momjian
289f10c809 Update release notes for 8.1.4. 2006-05-19 03:50:07 +00:00
Bruce Momjian
95d8b6a7b4 Backpatch FAQs to 8.1.X. 2006-05-19 03:34:49 +00:00
Bruce Momjian
9a27f72b37 Use SQL standard '' rather than \' in /contrib. Backpatch to 8.1.X. 2006-05-19 02:39:04 +00:00
Tom Lane
1c01a5108a Fix choose_bitmap_and() so that partial index predicates are considered when
deciding whether a potential additional indexscan is redundant or not.  As now
coded, any use of a partial index that was already used in a previous AND arm
will be rejected as redundant.  This might be overly restrictive, but not
considering the point at all is definitely bad, as per example in bug #2441
from Arjen van der Meijden.  In particular, a clauseless scan of a partial
index was *never* considered redundant by the previous coding, and that's
surely wrong.  Being more flexible would also require some consideration
of how not to double-count the index predicate's selectivity.
2006-05-18 19:56:56 +00:00
Tom Lane
59ca5ebf2c When a bitmap indexscan is using a partial index, it is necessary to include
the partial index predicate in the scan's "recheck condition".  Otherwise,
if the scan becomes lossy for lack of bitmap memory, we would fail to enforce
that returned rows satisfy the predicate.  Noted while studying bug #2441
from Arjen van der Meijden.
2006-05-18 18:57:37 +00:00
Bruce Momjian
4aec5303f0 Update pg_dump version wording. 2006-05-13 17:11:02 +00:00
Bruce Momjian
dfc2fc2522 Mention version portability of pg_dump. 2006-05-13 16:20:21 +00:00
Tom Lane
17e048603c Fix the sense of the test on DH_check()'s return value. This was preventing
custom-generated DH parameters from actually being used by the server.
Found by Michael Fuhr.
2006-05-12 22:44:43 +00:00
Tom Lane
988e59f452 Remove unnecessary .seg/.section directives, per Alan Stange. 2006-05-11 21:58:29 +00:00
Bruce Momjian
ae6124627b Use SQL standard '' rather than \' for tutorial/sample code.
Backpatch to 8.1.X.
2006-05-11 19:21:31 +00:00
Bruce Momjian
9083bdd288 Build server libpgport with all non-FRONTEND object files. This is to
fix a Win32 bug where pipe.c included a file that used FRONTEND, but it
wasn't on the server-build list.
2006-05-08 02:18:59 +00:00
Tom Lane
478335a1be Fix calculation of plan node extParams to account for the possibility that one
initPlan sets a parameter for another.  This could not (I think) happen before
8.1, but it's possible now because the initPlans generated by MIN/MAX
optimization might themselves use initPlans.  We attach those initPlans as
siblings of the MIN/MAX ones, not children, to avoid duplicate computation
when multiple MIN/MAX aggregates are present; so this leads to the case of an
initPlan needing the result of a sibling initPlan, which is not possible with
ordinary query nesting.  Hadn't been noticed because in most contexts having
too much stuff listed in extParam is fairly harmless.  Fixes "plan should not
reference subplan's variable" bug reported by Catalin Pitis.
2006-05-03 00:25:07 +00:00
Tom Lane
a3fe5ed594 Avoid assuming that statistics for a parent relation reflect the properties of
the union of its child relations as well.  This might have been a good idea
when it was originally coded, but it's a fatally bad idea when inheritance is
being used for partitioning.  It's better to have no stats at all than
completely misleading stats.  Per report from Mark Liberman.

The bug arguably exists all the way back, but I've only patched HEAD and 8.1
because we weren't particularly trying to support partitioning before 8.1.

Eventually we ought to look at deriving union statistics instead of just
punting, but for now the drop kick looks good.
2006-05-02 04:34:24 +00:00
Tom Lane
0619268b4b Remove the restriction originally coded into optimize_minmax_aggregates() that
MIN/MAX not be converted to use an index if the query WHERE clause contains
any volatile functions or subplans.

I had originally feared that the conversion might alter the behavior of such a
query with respect to a volatile function.  Well, so it might, but only in the
sense that the function would get evaluated at a subset of the table rows
rather than all of them --- and we have never made any such guarantee anyway.
(For instance, we don't refuse to use an index for an ordinary non-aggregate
query when one of the non-indexable filter conditions contains a volatile
function.)

The prohibition against subplans was because of worry that that case wasn't
adequately tested, which it wasn't, but it turns out to be possible to make
8.1 fail anyway:

regression=# select o.ten, (select max(unique2) from tenk1 i where ten = o.ten
or ten = (select f1 from int4_tbl limit 1)) from tenk1 o;
ERROR:  direct correlated subquery unsupported as initplan

This is due to bogus code in SS_make_initplan_from_plan (it's an initplan,
ergo it can't have any parParams).  Having fixed that, we might as well allow
subplans as well as initplans.
2006-04-28 20:57:59 +00:00
Bruce Momjian
96cc1341dd Fix SELECT INTO and CREATE TABLE AS to create tables in the default
tablespace, not the base directory.

Kris Jurka
2006-04-26 23:01:58 +00:00
Tom Lane
abee2cdb1e Revise large-object access routines to avoid running with CurrentMemoryContext
set to the large object context ("fscxt"), as this is inevitably a source of
transaction-duration memory leaks.  Not sure why we'd not noticed it before;
maybe people weren't touching a whole lot of LOs in the same transaction
before the 8.1 pg_dump changes.  Per report from Wayne Conrad.

Backpatched as far as 8.1, but the problem doubtless goes all the way back.
I'm disinclined to spend the time to try to verify that the older branches
would still work if patched, seeing that this code was significantly modified
for 8.0 and again for 8.1, and that we don't have any trouble reports before
8.1.  (Maybe the leaks were smaller before?)
2006-04-26 00:35:35 +00:00
Tom Lane
4454eead14 The 8.1 planner removes WHERE quals from the plan when the quals are
implied by the predicate of a partial index being used to scan a table.
However, this optimization is unsafe in an UPDATE, DELETE, or SELECT FOR
UPDATE query, because the quals need to be rechecked by EvalPlanQual if
there's an update conflict.  Per example from Jean-Samuel Reynaud.
2006-04-25 16:54:26 +00:00
Tom Lane
2c4abf11e1 Improve our private implementation of cbrt() to give results of the
accuracy expected by the regression tests.  Per suggestion from
Martijn van Oosterhout.
2006-04-24 20:36:41 +00:00
Michael Meskes
e37c0d2eb8 Fixed memory leak bugs found by Martijn Oosterhout. 2006-04-24 09:45:44 +00:00
Bruce Momjian
499ec8c7e4 Fixes for BCC 5.5 compile of libpq. Backpatch to 8.1.X.
Mark Morgan Lloyd
2006-04-24 04:03:42 +00:00
Alvaro Herrera
7f0c9716ba Don't add a shared dependency on the owner of a composite type in pg_class.
We track the owner in pg_type instead, as that is the place where the owner is
changed on ALTER TYPE ... OWNER TO.
2006-04-24 01:40:39 +00:00
Bruce Momjian
21138b5e59 Suggest Win32 users user E'' strings and double backslashes used for
patch separators in COPY.

Backpatch doubleing backslashes suggestion to 8.1.
2006-04-22 03:03:19 +00:00
Tom Lane
bc5ba26d6b Fix ancient memory leak in PQprintTuples(); our code no longer uses this
routine, but perhaps some applications do.  Found by Martijn van Oosterhout
using Coverity.
2006-04-19 16:15:34 +00:00
Bruce Momjian
6b46ec2707 Mention "syntax" error as not logged by log_statement.
Backpatch.
2006-04-18 12:41:29 +00:00
Bruce Momjian
65f1a7a8dc Document that errors are not output by log_statement (was they were in
8.0), and add as suggestion to use log_min_error_statement for this
purpose.  I also fixed the code so the first EXECUTE has it's prepare,
rather than the last which is what was in the current code.  Also remove
"protocol" prefix for SQL EXECUTE output because it is not accurate.

Backpatch to 8.1.X.
2006-04-18 00:52:41 +00:00
Bruce Momjian
dd8d1b1fbd Document that pg_dump -d/-D prevents invalid data from canceling the
entire table load.
2006-04-15 18:11:48 +00:00
Tom Lane
d17c5f0acc Fix similar_escape() so that SIMILAR TO works properly for patterns involving
alternatives ("|" symbol).  The original coding allowed the added ^ and $
constraints to be absorbed into the first and last alternatives, producing
a pattern that would match more than it should.  Per report from Eric Noriega.

I also changed the pattern to add an ARE director ("***:"), ensuring that
SIMILAR TO patterns do not change behavior if regex_flavor is changed.  This
is necessary to make the non-capturing parentheses work, and seems like a
good idea on general principles.

Back-patched as far as 7.4.  7.3 also has the bug, but a fix seems impractical
because that version's regex engine doesn't have non-capturing parens.
2006-04-13 18:01:38 +00:00
Bruce Momjian
9b83454f7f Update AIX FAQ:
At any rate, here's a revision to CVS HEAD to reflect some changes by
myself and by Seneca Cunningham for the AIX FAQ.  It touches on the
following issues:

1.  memcpy pointer patch for dynahash.c

2.  AIX memory management, which can, for 32 bit cases, bite people
    quite unexpectedly...

Chris Browne
2006-04-13 11:42:35 +00:00
Tom Lane
e4b8253c40 Fix pg_restore -n option to do what the man page says it does. The
original coding only worked if one of the selTypes restriction options
was also given.  Per report from Nick Johnson.
2006-04-12 22:19:01 +00:00