1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-01 14:21:49 +03:00

21791 Commits

Author SHA1 Message Date
Tom Lane
d8882a2c66 Fix qual_is_pushdown_safe to not try to push down quals involving a whole-row
Var referencing the subselect output.  While this case could possibly be made
to work, it seems not worth expending effort on.  Per report from Magnus
Naeslund(f).
2006-02-13 16:22:29 +00:00
Tom Lane
d72c32a0d1 Stamp 8.1.3. REL8_1_3 2006-02-12 22:37:44 +00:00
Tom Lane
ef434ebfbc Update release notes. 2006-02-12 22:35:36 +00:00
Tom Lane
20334a9e86 Fix bug that allowed any logged-in user to SET ROLE to any other database user
id (CVE-2006-0553).  Also fix related bug in SET SESSION AUTHORIZATION that
allows unprivileged users to crash the server, if it has been compiled with
Asserts enabled.  The escalation-of-privilege risk exists only in 8.1.0-8.1.2.
However, the Assert-crash risk exists in all releases back to 7.3.
Thanks to Akio Ishida for reporting this problem.
2006-02-12 22:32:57 +00:00
Tom Lane
b71e2bb122 Fix broken markup. 2006-02-12 21:13:00 +00:00
Bruce Momjian
68f34bf281 Update README file.
Joshua D. Drake
2006-02-12 19:24:35 +00:00
Bruce Momjian
544ccf6ce6 Update wording for 8.1.X, remove <only>:
This option can <only> be set at server start or in the
        <filename>postgresql.conf</filename> configuration file.
2006-02-12 19:19:37 +00:00
Bruce Momjian
a22873a19e > Actually, if you submit a patch that says either "SCROLL is the
default"
> or "NO SCROLL is the default", it will be rejected as incorrect.  The
> reason is that the default behavior is different from either of these,
> as is explained in the NOTES section.

Ok, so *that's* where the bit about the query plan being simple enough.
Based on that, ISTM that it should be premissable for us to decide that
a cursor requiring a sort isn't "simple enough" to support SCROLL.

In any case, here's a patch that makes the non-standard behavior easier
for people to find.

Jim C. Nasby
2006-02-12 19:02:28 +00:00
Bruce Momjian
34d9bbee4d Stamp releases for 2006-02-14 release 2006-02-12 18:42:20 +00:00
Bruce Momjian
003daafb0d Fix release item ordering. 2006-02-12 18:14:29 +00:00
Bruce Momjian
12ea69aaf5 Update back branch release notes. 2006-02-12 17:58:31 +00:00
Bruce Momjian
d9dafcc5d6 Fix release markup. 2006-02-12 17:28:23 +00:00
Bruce Momjian
a318438fb3 Stamp 8.1.3, but exclude configure.in/configure change. 2006-02-12 17:17:39 +00:00
Bruce Momjian
3a9c81e3e9 Update release notes for 8.1.3. 2006-02-12 17:11:28 +00:00
Tom Lane
b919f3fcbb Check that SID is enabled while checking for Windows admin privileges.
Magnus
2006-02-10 21:52:34 +00:00
Tom Lane
2d26c4be8e Change search for default operator classes so that it examines all opclasses
regardless of the current schema search path.  Since CREATE OPERATOR CLASS
only allows one default opclass per datatype regardless of schemas, this
should have minimal impact, and it fixes problems with failure to find a
desired opclass while restoring dump files.  Per discussion at
http://archives.postgresql.org/pgsql-hackers/2006-02/msg00284.php.
Remove now-redundant-or-unused code in typcache.c and namespace.c,
and backpatch as far as 8.0.
2006-02-10 19:01:22 +00:00
Tom Lane
f9e03aa8e9 Provide the libpq error message when PQputline or PQendcopy fails. 2006-02-09 18:28:35 +00:00
Tom Lane
f527f082c5 Reject out-of-range dates in date_in().
Kris Jurka
2006-02-09 03:40:30 +00:00
Bruce Momjian
cfcf54ac89 Fix HTML alignment in PQprint.
Christoph Zwerschke
2006-02-07 00:26:38 +00:00
Bruce Momjian
763b9c1901 Fix PQprint HTML tag, "centre" -> "center". 2006-02-06 02:23:17 +00:00
Tom Lane
7d41ef1a92 Fix pg_restore to properly discard COPY data when trying to continue
after an error in a COPY statement.  Formerly it thought the COPY data
was SQL commands, and got quite confused.

Stephen Frost
2006-02-05 20:58:57 +00:00
Bruce Momjian
c75c372c58 Fix typo in configuration docs.
Devrim GUNDUZ
2006-02-05 18:19:33 +00:00
Bruce Momjian
3bf6284f10 Update PL/pgSQL trigger example to be clearer about how to "merge" data
into a table.

Jim C. Nasby
2006-02-05 02:48:20 +00:00
Bruce Momjian
180b23cb22 Fix const cast in get_progname().
Backpatch.
2006-02-01 12:42:00 +00:00
Bruce Momjian
bc1c9adbda Set progname early in the postmaster/postgres binary, rather than doing
it later.  This fixes a problem where EXEC_BACKEND didn't have progname
set, causing a segfault if log_min_messages was set below debug2 and our
own snprintf.c was being used.

Also alway strdup() progname.

Backpatch to 8.1.X and 8.0.X.
2006-02-01 00:32:06 +00:00
Tom Lane
2aa231be9e Allow %TYPE to be used with SETOF, per gripe from Murat Tasan. 2006-01-31 22:40:12 +00:00
Tom Lane
ecde4216c9 Fix ALTER COLUMN TYPE bug: it sometimes tried to drop UNIQUE or PRIMARY KEY
constraints before FOREIGN KEY constraints that depended on them.  Originally
reported by Neil Conway on 29-Jun-2005.  Patch by Nakano Yoshihisa.
2006-01-30 16:19:04 +00:00
Tom Lane
0ab9d3a3e1 When building a bitmap scan, must copy the bitmapqualorig expression tree
to avoid sharing substructure with the lower-level indexquals.  This is
currently only an issue if there are SubPlans in the indexquals, which is
uncommon but not impossible --- see bug #2218 reported by Nicholas Vinen.
We use the same kluge for indexqual vs indexqualorig in the index scans
themselves ... would be nice to clean this up someday.
2006-01-29 18:55:55 +00:00
Tom Lane
2d98f46255 Fix code that checks to see if an index can be considered to match the query's
requested sort order.  It was assuming that build_index_pathkeys always
generates a pathkey per index column, which was not true if implied equality
deduction had determined that two index columns were effectively equated to
each other.  Simplest fix seems to be to install an option that causes
build_index_pathkeys to support this behavior as well as the original one.
Per report from Brian Hirt.
2006-01-29 17:27:50 +00:00
Andrew Dunstan
18d6948858 Undo perl's nasty locale setting on Windows. Since we can't do that as
elsewhere by setting the environment appropriately, we make perl do it
right after interpreter startup by calling its POSIX::setlocale().
2006-01-28 16:21:33 +00:00
Neil Conway
81dbda0792 Per a bug report from Theo Schlossnagle, plperl_return_next() leaks
memory in the executor's per-query memory context. It also inefficient:
it invokes get_call_result_type() and TupleDescGetAttInMetadata() for
every call to return_next, rather than invoking them once (per PL/Perl
function call) and memoizing the result.

This patch makes the following changes:

- refactor the code to include all the "per PL/Perl function call" data
inside a single struct, "current_call_data". This means we don't need to
save and restore N pointers for every recursive call into PL/Perl, we
can just save and restore one.

- lookup the return type metadata needed by plperl_return_next() once,
and then stash it in "current_call_data", so as to avoid doing the
lookup for every call to return_next.

- create a temporary memory context in which to evaluate the return
type's input functions. This memory context is reset for each call to
return_next.

The patch appears to fix the memory leak, and substantially reduces
the overhead imposed by return_next.
2006-01-28 03:28:19 +00:00
Tom Lane
108a2e51c9 Fix display of whole-row Var appearing at the top level of a SELECT list.
While we normally prefer the notation "foo.*" for a whole-row Var, that does
not work at SELECT top level, because in that context the parser will assume
that what is wanted is to expand the "*" into a list of separate target
columns, yielding behavior different from a whole-row Var.  We have to emit
just "foo" instead in that context.  Per report from Sokolov Yura.
2006-01-26 17:08:26 +00:00
Tom Lane
f31a58481c Remove unnecessary PQconsumeInput call from PQputCopyData; it's redundant
because pqSendSome will absorb input data anytime it'd be forced to block.
Avoiding a kernel call per PQputCopyData call helps COPY speed materially.

Alon Goldshuv
2006-01-25 20:44:49 +00:00
Tom Lane
b34608fbdd Fix unportable usage of socklen_t: should use ACCEPT_TYPE_ARG3 macro
provided by configure, instead.  Per bug #2205.
2006-01-24 16:38:50 +00:00
Tom Lane
16582d3834 Repair longstanding bug in slru/clog logic: it is possible for two backends
to try to create a log segment file concurrently, but the code erroneously
specified O_EXCL to open(), resulting in a needless failure.  Before 7.4,
it was even a PANIC condition :-(.  Correct code is actually simpler than
what we had, because we can just say O_CREAT to start with and not need a
second open() call.  I believe this accounts for several recent reports of
hard-to-reproduce "could not create file ...: File exists" errors in both
pg_clog and pg_subtrans.
2006-01-21 04:38:27 +00:00
Tom Lane
4977c2b31b Replace bitwise looping with bytewise looping in hemdistsign and
sizebitvec of tsearch2, as well as identical code in several other
contrib modules.  This provided about a 20X speedup in building a
large tsearch2 index ... didn't try to measure its effects for other
operations.  Thanks to Stephan Vollmer for providing a test case.
2006-01-20 22:46:40 +00:00
Bruce Momjian
4a651c9705 Update EXPLAIN wording for GEQO usage. 2006-01-20 16:42:02 +00:00
Tom Lane
517056bd08 Fix thinko in autovacuum's test to skip temp tables: want to skip any
temp table not only our own process' tables.  It's not real important
since vacuum.c will skip temp tables anyway, but might as well make the
code do what it claims to do.
2006-01-20 15:17:13 +00:00
Bruce Momjian
936433ba53 Doc patch that adds an example of a correllated UPDATE.
David Fetter
2006-01-19 23:09:46 +00:00
Bruce Momjian
b148ce8a4a Clarify STABLE function documentation to highlight how such functions
can be optimized.
2006-01-19 22:52:20 +00:00
Tom Lane
337cc41236 Add some test scaffolding to allow cache-flush stress testing (and I do
mean stress ... system is orders of magnitude slower with this enabled).
2006-01-19 21:49:30 +00:00
Bruce Momjian
36cdb24f31 Remove $(DESTDIR) from the pgxs BE_DLLLIBS= -L path for AIX and Darwin. 2006-01-19 21:19:15 +00:00
Bruce Momjian
128cd9df38 Remove $(DESTDIR) from the pgxs BE_DLLLIBS= -L path. 2006-01-19 20:45:34 +00:00
Tom Lane
ab2cd7266b Avoid crashing if relcache flush occurs while trying to load data into an
index's support-function cache (in index_getprocinfo).  Since none of that
data can change for an index that's in active use, it seems sufficient to
treat all open indexes the same way we were treating "nailed" system indexes
--- that is, just re-read the pg_class row and leave the rest of the relcache
entry strictly alone.  The pg_class re-read might not be strictly necessary
either, but since the reltablespace and relfilenode can change in normal
operation it seems safest to do it.  (We don't support changing any of the
other info about an index at all, at the moment.)

Back-patch as far as 8.0.  It might be possible to adapt the patch to 7.4,
but it would take more work than I care to expend for such a low-probability
problem.  7.3 is out of luck for sure.
2006-01-19 20:28:48 +00:00
Bruce Momjian
b5dc7165fe Fix pgxs -L library path specification for Win32 and Cygwin, was /bin,
now /lib.
2006-01-19 20:01:01 +00:00
Tom Lane
7618330c6d It turns out that TablespaceCreateDbspace fails badly if a relcache flush
occurs when it tries to heap_open pg_tablespace.  When control returns to
smgrcreate, that routine will be holding a dangling pointer to a closed
SMgrRelation, resulting in mayhem.  This is of course a consequence of
the violation of proper module layering inherent in having smgr.c call
a tablespace command routine, but the simplest fix seems to be to change
the locking mechanism.  There's no real need for TablespaceCreateDbspace
to touch pg_tablespace at all --- it's only opening it as a way of locking
against a parallel DROP TABLESPACE command.  A much better answer is to
create a special-purpose LWLock to interlock these two operations.
This drops TablespaceCreateDbspace quite a few layers down the food chain
and makes it something reasonably safe for smgr to call.
2006-01-19 04:45:47 +00:00
Tom Lane
49a263011a Fix a tiny memory leak (one List header) in RelationCacheInvalidate().
This is utterly insignificant in normal operation, but it becomes a
problem during cache inval stress testing.  The original coding in fact
had no leak --- the 8.0 List rewrite created the issue.  I wonder whether
list_concat should pfree the discarded header?
2006-01-19 00:27:27 +00:00
Bruce Momjian
2e2c4f424f Clarify use of btree indexes for ILIKE and ~*. 2006-01-18 22:26:01 +00:00
Tom Lane
0bfd90ff32 Modify pgstats code to reduce performance penalties from oversized stats data
files: avoid creating stats hashtable entries for tables that aren't being
touched except by vacuum/analyze, ensure that entries for dropped tables are
removed promptly, and tweak the data layout to avoid storing useless struct
padding.  Also improve the performance of pgstat_vacuum_tabstat(), and make
sure that autovacuum invokes it exactly once per autovac cycle rather than
multiple times or not at all.  This should cure recent complaints about 8.1
showing much higher stats I/O volume than was seen in 8.0.  It'd still be a
good idea to revisit the design with an eye to not re-writing the entire
stats dataset every half second ... but that would be too much to backpatch,
I fear.
2006-01-18 20:35:16 +00:00
Tom Lane
9e72b3c2c5 Fix fsync code to test whether F_FULLFSYNC is available, instead of
assuming it always is on Darwin.  Per report from Neil Brandt.
2006-01-17 23:52:50 +00:00