Commit Graph

21920 Commits

Author SHA1 Message Date
Peter Eisentraut 50610ef8b5 Remove some checks for libraries that no one can identify. We'll see how
that works out...
2006-02-07 11:22:41 +00:00
Bruce Momjian 04a942e31e Split up wal-logging items:
< * Allow control over which tables are WAL-logged [walcontrol]
> * Allow WAL logging to be turned off for a table, but the table
>   might be dropped or truncated during crash recovery [walcontrol]
<   commit.  To do this, only a single writer can modify the table, and
<   writes must happen only on new pages.  Readers can continue accessing
<   the table.  This would affect COPY, and perhaps INSERT/UPDATE too.
<   Another option is to avoid transaction logging entirely and truncate
<   or drop the table on crash recovery.  These should be implemented
<   using ALTER TABLE, e.g. ALTER TABLE PERSISTENCE [ DROP | TRUNCATE |
<   STABLE | DEFAULT ].  Tables using non-default logging should not use
<   referential integrity with default-logging tables, and tables using
<   stable logging probably can not have indexes.  One complexity is
<   the handling of indexes on TOAST tables.
>   commit.  This should be implemented using ALTER TABLE, e.g. ALTER
>   TABLE PERSISTENCE [ DROP | TRUNCATE | DEFAULT ].  Tables using
>   non-default logging should not use referential integrity with
>   default-logging tables.  A table without dirty buffers during a
>   crash could perhaps avoid the drop/truncate.
>
> * Allow WAL logging to be turned off for a table, but the table would
>   avoid being truncated/dropped [walcontrol]
>
>   To do this, only a single writer can modify the table, and writes
>   must happen only on new pages so the new pages can be removed during
>   crash recovery.  Readers can continue accessing the table.  Such
>   tables probably cannot have indexes.  One complexity is the handling
>   of indexes on TOAST tables.
2006-02-07 02:08:08 +00:00
Bruce Momjian 8bf47f455f Fix HTML alignment in PQprint.
Christoph Zwerschke
2006-02-07 00:26:15 +00:00
Tom Lane 72153c0582 Improve the tests to see if ScalarArrayOpExpr is strict. Original coding
would basically punt in all cases for 'foo <> ALL (array)', which resulted
in a performance regression for NOT IN compared to what we were doing in
8.1 and before.  Per report from Pavel Stehule.
2006-02-06 22:21:12 +00:00
Teodor Sigaev a6fefc866c Check number of affixes to prevent core dump with zero number of affixes 2006-02-06 15:45:34 +00:00
Bruce Momjian 9ce51f3aa6 Fix PQprint HTML tag, "centre" -> "center". 2006-02-06 02:23:07 +00:00
Tom Lane 8e4057cc7d 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:47 +00:00
Bruce Momjian db5e39b2f0 Fix typo in configuration docs.
Devrim GUNDUZ
2006-02-05 18:19:14 +00:00
Tom Lane 336a6491aa Improve my initial, rather hacky implementation of joins to append
relations: fix the executor so that we can have an Append plan on the
inside of a nestloop and still pass down outer index keys to index scans
within the Append, then generate such plans as if they were regular
inner indexscans.  This avoids the need to evaluate the outer relation
multiple times.
2006-02-05 02:59:17 +00:00
Bruce Momjian 354213c7f4 Update PL/pgSQL trigger example to be clearer about how to "merge" data
into a table.

Jim C. Nasby
2006-02-05 02:47:53 +00:00
Tom Lane 3893127431 Fix constraint exclusion to work in inherited UPDATE/DELETE queries
... in fact, it will be applied now in any query whatsoever.  I'm still
a bit concerned about the cycles that might be expended in failed proof
attempts, but given that CE is turned off by default, it's the user's
choice whether to expend those cycles or not.  (Possibly we should
change the simple bool constraint_exclusion parameter to something
more fine-grained?)
2006-02-04 23:03:20 +00:00
Tom Lane 48d9ad3722 Fix broken markup. 2006-02-04 22:38:39 +00:00
Michael Meskes a13c1edb57 Added C bit fields to ecpg parser
Added some default rules to lexer
Added log output to prepare statement
Added some more stuff to a test case
2006-02-04 20:54:44 +00:00
Andrew Dunstan f8b54fe6ed DROP IF EXISTS for ROLE/USER/GROUP 2006-02-04 19:06:47 +00:00
Peter Eisentraut 3fa9c416ed Issue a warning if a change-on-restart-only postgresql.conf value is
modified  and the server config files are reloaded
2006-02-04 12:50:47 +00:00
Bruce Momjian bc6a824ca6 Update walcontrol item:
< * Allow control over which tables are WAL-logged
> * Allow control over which tables are WAL-logged [walcontrol]
1038c1038,1039
<   stable logging probably can not have indexes.  [walcontrol]
>   stable logging probably can not have indexes.  One complexity is
>   the handling of indexes on TOAST tables.
2006-02-04 03:23:21 +00:00
Bruce Momjian 3f8984039a Add to TODO.detail/walcontrol. 2006-02-04 03:22:36 +00:00
Bruce Momjian b3769066b8 In ecpg, automatically double single quotes in $$ strings because
internally $$ strings are converted to single-quote strings.

In ecpg, output newlines in commands using standard C escapes, rather
than using literal newlines, which is not portable.
2006-02-04 02:32:38 +00:00
Bruce Momjian 9190b4da5d Update Makefile for new thread_test location. 2006-02-04 01:04:20 +00:00
Bruce Momjian 9e66c3e6fe Move thread_test directory from /tools to /test so source-only tarballs
have the directory for the configure test.
2006-02-04 01:00:02 +00:00
Peter Eisentraut 0e04982e78 First attempt at removing some AC_CHECK_LIB(foo, main) calls. 2006-02-04 00:42:54 +00:00
Tom Lane 8b109ebf14 Teach planner to convert simple UNION ALL subqueries into append relations,
thereby sharing code with the inheritance case.  This puts the UNION-ALL-view
approach to partitioned tables on par with inheritance, so far as constraint
exclusion is concerned: it works either way.  (Still need to update the docs
to say so.)  The definition of "simple UNION ALL" is a little simpler than
I would like --- basically the union arms can only be SELECT * FROM foo
--- but it's good enough for partitioned-table cases.
2006-02-03 21:08:49 +00:00
Bruce Momjian a25b1decef Update tested AIX memset platforms. 2006-02-03 13:56:20 +00:00
Bruce Momjian ebd38e3c1d Allow MEMSET_LOOP_LIMIT to be set on a per-platform basis, and turn off
MemSet on AIX by setting MEMSET_LOOP_LIMIT to zero.

Add optimization to skip MemSet tests in MEMSET_LOOP_LIMIT == 0 case and
just call memset() directly.
2006-02-03 13:53:15 +00:00
Bruce Momjian 59bb147353 Update random() usage so ranges are inclusive/exclusive as required. 2006-02-03 12:45:47 +00:00
Bruce Momjian eb7bd06983 Prevent COPY from using newline or carriage return as delimiter or null.
Disallow backslash as the delimiter in non-CVS mode.

David Fetter
2006-02-03 12:41:07 +00:00
Bruce Momjian 890707a537 Improve tab whitespace in file.
Add comment about $$ and '' SCONST strings.
2006-02-03 05:38:35 +00:00
Bruce Momjian 46dfa5ec83 More spacing cleanups. 2006-02-02 03:51:41 +00:00
Bruce Momjian d63901c9d0 Source code alignment fixes for preproc.y. 2006-02-01 22:16:36 +00:00
Bruce Momjian a274239bce More alignment improvements. 2006-02-01 20:57:39 +00:00
Bruce Momjian 71b9df2bed Make pgc.l source code alignment consistent. 2006-02-01 20:56:44 +00:00
Bruce Momjian bd5d12a16b Add:
> * Allow statistics collector information to be pulled from the collector
>   process directly, rather than requiring the collector to write a
>   filesystem file twice a second?
2006-02-01 17:32:45 +00:00
Bruce Momjian 47a86fa02d Add code comment about Linux stack randomization and shared memory. 2006-02-01 16:00:06 +00:00
Bruce Momjian 802c7aa30f Fix const cast in get_progname().
Backpatch.
2006-02-01 12:41:45 +00:00
Bruce Momjian 62a142036b 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:31:59 +00:00
Bruce Momjian c6ef3264be Move items:
> * Add SQL99 WITH clause to SELECT
> * Add SQL99 WITH RECURSIVE to SELECT
< * Add SQL99 WITH clause to SELECT
< * Add SQL99 WITH RECURSIVE to SELECT
2006-02-01 00:07:26 +00:00
Bruce Momjian 5eb29fea25 Add:
>
> 	o Prevent tab completion of SET TRANSACTION from querying the
> 	  database and therefore preventing the transaction isolation
> 	  level from being set.
>
> 	  Currently, SET <tab> causes a database lookup to check all
> 	  supported session variables.  This query causes problems
> 	  because setting the transaction isolation level must be the
> 	  first statement of a transaction.
2006-02-01 00:03:09 +00:00
Tom Lane 6851baeda1 Allow %TYPE to be used with SETOF, per gripe from Murat Tasan. 2006-01-31 22:40:03 +00:00
Tom Lane 8a1468af4e Restructure planner's handling of inheritance. Rather than processing
inheritance trees on-the-fly, which pretty well constrained us to considering
only one way of planning inheritance, expand inheritance sets during the
planner prep phase, and build a side data structure that can be consulted
later to find which RTEs are members of which inheritance sets.  As proof of
concept, use the data structure to plan joins against inheritance sets more
efficiently: we can now use indexes on the set members in inner-indexscan
joins.  (The generated plans could be improved further, but it'll take some
executor changes.)  This data structure will also support handling UNION ALL
subqueries in the same way as inheritance sets, but that aspect of it isn't
finished yet.
2006-01-31 21:39:25 +00:00
Michael Meskes 097df388b7 Removed single quotes from connect to example. 2006-01-31 13:32:20 +00:00
Tom Lane 0dd0e289c7 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:18:58 +00:00
Tom Lane 3276e911d1 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:48 +00:00
Tom Lane 3edec383e1 Fix Assert that's no longer correct now that RowCompareExpr is indexable. 2006-01-29 17:40:00 +00:00
Tom Lane a1b7e70c5f 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:42 +00:00
Andrew Dunstan 4400ca2bad 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:20:31 +00:00
Neil Conway ebdefb93b2 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:15 +00:00
Tom Lane cab99ec300 Tweak initdb to reduce verbosity of progress messages, by printing just
one 'creating subdirectories' message instead of one per subdirectory.
The original decision to print something for each subdirectory was made
when there were only one or two of 'em; we have way too many now.
Per discussion.
2006-01-27 19:01:15 +00:00
Teodor Sigaev 5e2707c45f Snowball multibyte. It's a pity, but snowball sources is very diferent for multibyte and
singlebyte encodings, so we should have snowball for every encodings.

I hope that finalize multibyte support work in tsearch2, but testing is needed...
2006-01-27 16:32:31 +00:00
Tom Lane 75c4747156 Suppress signed-vs-unsigned-char warning. 2006-01-26 18:08:10 +00:00
Tom Lane ec057a4380 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:19 +00:00