Commit Graph

24521 Commits

Author SHA1 Message Date
Bruce Momjian 832b6d00e9 Properly enforce pg_dump -F formation options; only single letter or
full words support, per report from Mark Stosberg.
2007-03-22 19:42:02 +00:00
Alvaro Herrera 8f65c02f33 Remove the currently unused FRONTEND case in dllist.c. This allows the usage
of palloc instead of malloc, which means a list can be freed simply by deleting
the memory context that contains it.
2007-03-22 18:57:52 +00:00
Teodor Sigaev bb8998a475 Fix parser bug on Windows with UTF8 encoding and C locale, the reason was
sizeof(wchar_t) = 2 instead of 4.
2007-03-22 15:58:24 +00:00
Bruce Momjian c68a631ce7 Remove tabs in SGML files. 2007-03-22 15:46:56 +00:00
Bruce Momjian 183c12e0d7 Remove tabs from SGML file. 2007-03-22 15:45:56 +00:00
Magnus Hagander d55227f01b Forgot to add file needed for PL regression tests 2007-03-22 13:43:02 +00:00
Tom Lane 54d20024c1 Fix some problems with selectivity estimation for partial indexes.
First, genericcostestimate() was being way too liberal about including
partial-index conditions in its selectivity estimate, resulting in
substantial underestimates for situations such as an indexqual "x = 42"
used with an index on x "WHERE x >= 40 AND x < 50".  While the code is
intentionally set up to favor selecting partial indexes when available,
this was too much...

Second, choose_bitmap_and() was likewise easily fooled by cases of this
type, since it would similarly think that the partial index had selectivity
independent of the indexqual.

Fixed by using predicate_implied_by() rather than simple equality checks
to determine redundancy.  This is a good deal more expensive but I don't
see much alternative.  At least the extra cost is only paid when there's
actually a partial index under consideration.

Per report from Jeff Davis.  I'm not going to risk back-patching this,
though.
2007-03-21 22:18:12 +00:00
Bruce Momjian 2b49e5d3cb Add:
<
<
> 	o During index creation, pre-sort the tuples to improve build speed
>
> 	  http://archives.postgresql.org/pgsql-hackers/2007-03/msg01199.php
>
2007-03-21 21:25:46 +00:00
Bruce Momjian 5fc7ba76dd Remove TODO item, not wanted:
< * Add NUMERIC division operator that doesn't round?
<
<   Currently NUMERIC _rounds_ the result to the specified precision.
<   This means division can return a result that multiplied by the
<   divisor is greater than the dividend, e.g. this returns a value > 10:
<
<     SELECT (10::numeric(2,0) / 6::numeric(2,0))::numeric(2,0) * 6;
<
<   The positive modulus result returned by NUMERICs might be considered
<   inaccurate, in one sense.
<
2007-03-21 21:21:21 +00:00
Magnus Hagander 17fdd7833e Add documentation about vcregress. 2007-03-21 19:22:52 +00:00
Bruce Momjian bebbea0c1e Add URL for:
* Add locale-aware MONEY type, and support multiple currencies
  http://archives.postgresql.org/pgsql-hackers/2007-03/msg01181.php
2007-03-21 16:43:31 +00:00
Magnus Hagander e8a85e6f84 Add support for running regression tests on procedural languages 2007-03-21 16:21:40 +00:00
Magnus Hagander 3c5d5f070a Properly return exitcode when regression tests fails. 2007-03-21 15:39:03 +00:00
Magnus Hagander 18d82d03b5 Native shared memory implementation for win32.
Uses same underlying tech as before, but not the sysv emulation layer.
2007-03-21 14:39:23 +00:00
Bruce Momjian 3b765dba78 Add URL for:
* Allow accurate statistics to be collected on indexes with more than
  one column or expression indexes, perhaps using per-index statistics
>   http://archives.postgresql.org/pgsql-hackers/2007-03/msg01131.php
2007-03-21 00:33:08 +00:00
Bruce Momjian c45fa5598b In FAQ, reference upgrade info via URL. 2007-03-20 17:43:57 +00:00
Bruce Momjian d89b968319 Not done, reverted:
< 	o -Allow commenting of variables in postgresql.conf to restore them
> 	o Allow commenting of variables in postgresql.conf to restore them
2007-03-20 16:36:20 +00:00
Bruce Momjian e7bb07ea13 Done:
> 	o -Allow commenting of variables in postgresql.conf to restore them
< 	  http://archives.postgresql.org/pgsql-hackers/2006-09/msg01481.php
2007-03-20 16:32:42 +00:00
Neil Conway 9eb78beeae Add three new regexp functions: regexp_matches, regexp_split_to_array,
and regexp_split_to_table. These functions provide access to the
capture groups resulting from a POSIX regular expression match,
and provide the ability to split a string on a POSIX regular
expression, respectively. Patch from Jeremy Drake; code review by
Neil Conway, additional comments and suggestions from Tom and
Peter E.

This patch bumps the catversion, adds some regression tests,
and updates the docs.
2007-03-20 05:45:00 +00:00
Jan Wieck 5e96b04a7c Bumping catversion due to changes to pg_trigger and pg_rewrite.
BTW, the comment in this file says that we hope we never have more than
10 catversion changes per day, but to even make this possible we should
start counting at zero, shouldn't we?


Jan
2007-03-20 03:53:26 +00:00
Jan Wieck 0fe16500d3 Changes pg_trigger and extend pg_rewrite in order to allow triggers and
rules to be defined with different, per session controllable, behaviors
for replication purposes.

This will allow replication systems like Slony-I and, as has been stated
on pgsql-hackers, other products to control the firing mechanism of
triggers and rewrite rules without modifying the system catalog directly.

The firing mechanisms are controlled by a new superuser-only GUC
variable, session_replication_role, together with a change to
pg_trigger.tgenabled and a new column pg_rewrite.ev_enabled. Both
columns are a single char data type now (tgenabled was a bool before).
The possible values in these attributes are:

     'O' - Trigger/Rule fires when session_replication_role is "origin"
           (default) or "local". This is the default behavior.

     'D' - Trigger/Rule is disabled and fires never

     'A' - Trigger/Rule fires always regardless of the setting of
           session_replication_role

     'R' - Trigger/Rule fires when session_replication_role is "replica"

The GUC variable can only be changed as long as the system does not have
any cached query plans. This will prevent changing the session role and
accidentally executing stored procedures or functions that have plans
cached that expand to the wrong query set due to differences in the rule
firing semantics.

The SQL syntax for changing a triggers/rules firing semantics is

     ALTER TABLE <tabname> <when> TRIGGER|RULE <name>;

     <when> ::= ENABLE | ENABLE ALWAYS | ENABLE REPLICA | DISABLE

psql's \d command as well as pg_dump are extended in a backward
compatible fashion.

Jan
2007-03-19 23:38:32 +00:00
Bruce Momjian e927f8f14e Remove last line of patch license, per Zeugswetter Andreas:
"If the patch is not BSD-licensed, it will be rejected."
2007-03-19 16:53:03 +00:00
Tom Lane e28e318c65 Further buildfarm experience shows that actually we can't run the plancache
test in parallel with the rules test at all, because the former wants to
create a couple of temp views, which can sometimes show up in the latter's
output.  Let's try it in the next parallel group instead.
2007-03-19 16:44:41 +00:00
Tom Lane 9bc933b212 Fix 8.2 breakage of domains over array types, and add a regression test case
to cover it.  Per report from Anton Pikhteryev.
2007-03-19 16:30:32 +00:00
Bruce Momjian 79929fff76 Add URL for:
* Simplify ability to create partitioned tables
>   http://archives.postgresql.org/pgsql-hackers/2007-03/msg00375.php
2007-03-19 15:50:48 +00:00
Bruce Momjian 00c56bb7f8 Add URL for:
* Allow sequential scans to take advantage of other concurrent
  sequential scans, also called "Synchronised Scanning"

  http://archives.postgresql.org/pgsql-hackers/2007-03/msg00415.php
2007-03-19 15:24:17 +00:00
Magnus Hagander 62df7c31c0 ecpglib requires libpgport, per Andrew Dunstan 2007-03-19 09:34:09 +00:00
Tom Lane 584b6dc2d5 Fix ecpg/preproc makefile for parallel builds: parser.o must depend
on preproc.h, else make may try to build it before preproc.h is ready.
Per failures seen here and in buildfarm.
2007-03-18 17:57:34 +00:00
Neil Conway 7221b4fa50 Code cleanup: mark some variables with the "const" modifier, when they
are initialized with a string literal. Patch from Stefan Huehner.
2007-03-18 16:50:44 +00:00
Neil Conway b9954fbb4e Code cleanup for function prototypes: change two K&R-style prototypes
to ANSI-style, and change "()" -> "(void)". Patch from Stefan Huehner.
2007-03-18 05:36:50 +00:00
Michael Meskes 582e22a8c3 Simplified sortby rule 2007-03-17 19:27:12 +00:00
Michael Meskes d3e131e062 - Changed some whitespacing in connect statement.
- Made some chars const as proposed by Stefan Huehner <stefan@huehner.org>.
- Synced parser and keyword lists.
- Copied two token parsing from backend parser to ecpg parser.
- Also added a test case for this.
2007-03-17 19:25:24 +00:00
Magnus Hagander e6e78187ef msvc build actually needs Bison 2.2 or later, not 2.1. Or 1.875 as before. 2007-03-17 17:11:41 +00:00
Magnus Hagander 15f4842d70 Add note that diff is required for regression tests. 2007-03-17 14:30:00 +00:00
Magnus Hagander 7bb40f9b82 Add cvs tags to msvc build files, along with a (very short) comment about
what each script does.
2007-03-17 14:01:01 +00:00
Magnus Hagander 4554ee362c Oops, forgot to remove the old genbki script. 2007-03-17 13:54:34 +00:00
Magnus Hagander 08bb618561 Turn most vc build scripts into modules instead of scripts, and just have
skeleton scripts calling them. To make it easier for the buildfarm
(or other "outside callers") to use these modules directly.

Per suggestion from Andrew Dunstan.
2007-03-17 13:50:42 +00:00
Tom Lane cdf8b56d54 SPI_cursor_open failed to enforce that only read-only queries could be
executed in read_only mode.  This could lead to various relatively-subtle
failures, such as an allegedly stable function returning non-stable results.
Bug goes all the way back to the introduction of read-only mode in 8.0.
Per report from Gaetano Mendola.
2007-03-17 03:15:38 +00:00
Tom Lane e88a7ad774 Ooops, got only one of the two ArrayExpr variants correct in first
cut at exprTypmod support.  Also, experimentation shows that we need
to label the type of Const nodes that are numeric with a specific
typmod.
2007-03-17 01:15:55 +00:00
Tom Lane 0f4ff460c4 Fix up the remaining places where the expression node structure would lose
available information about the typmod of an expression; namely, Const,
ArrayRef, ArrayExpr, and EXPR and ARRAY SubLinks.  In the ArrayExpr and
SubLink cases it wasn't really the data structure's fault, but exprTypmod()
being lazy.  This seems like a good idea in view of the expected increase in
typmod usage from Teodor's work to allow user-defined types to have typmods.
In particular this responds to the concerns we had about eliminating the
special-purpose hack that exprTypmod() used to have for BPCHAR Consts.
We can now tell whether or not such a Const has been cast to a specific
length, and report or display properly if so.

initdb forced due to changes in stored rules.
2007-03-17 00:11:05 +00:00
Magnus Hagander 51d7741db1 Add new columns for tuple statistics on a database level to
pg_stat_database.
2007-03-16 17:57:36 +00:00
Tom Lane c4fdfb8de3 Fix race condition in parallel regression tests. The new plancache test
was expecting there to be no regular table named 'foo', but it turns out
the rules test transiently creates one, so that plancache would sometimes
fail.  I couldn't reproduce that in quite a few tries here, but several
buildfarm machines have shown the failure.  Fix by renaming plancache's
temp table to something nonconflicting.
2007-03-16 16:11:49 +00:00
Alvaro Herrera c9d3b8f5d2 Fix uninitialized value in pgstatindex leading to invalid values being
reported in some cases.  Report and patch from Tatsuhito Kasahara.

Also fix a couple of other bugs I noticed in skimming the surrounding code.
2007-03-16 15:06:43 +00:00
Andrew Dunstan f6e3313fea Remove undocumented support for copy syntax from before 7.3. Update comments to
reflect syntax actually supported, e.g. by including CSV params.
2007-03-16 13:41:21 +00:00
Magnus Hagander 348b621894 Show aggregate return types in psql \da output.
Greg Sabino Mullane
2007-03-16 08:28:01 +00:00
Tom Lane 95f6d2d209 Make use of plancache module for SPI plans. In particular, since plpgsql
uses SPI plans, this finally fixes the ancient gotcha that you can't
drop and recreate a temp table used by a plpgsql function.

Along the way, clean up SPI's API a little bit by declaring SPI plan
pointers as "SPIPlanPtr" instead of "void *".  This is cosmetic but
helps to forestall simple programming mistakes.  (I have changed some
but not all of the callers to match; there are still some "void *"'s
in contrib and the PL's.  This is intentional so that we can see if
anyone's compiler complains about it.)
2007-03-15 23:12:07 +00:00
Tom Lane d3ff180163 Fix a longstanding bug in VACUUM FULL's handling of update chains. The code
did not expect that a DEAD tuple could follow a RECENTLY_DEAD tuple in an
update chain, but because the OldestXmin rule for determining deadness is a
simplification of reality, it is possible for this situation to occur
(implying that the RECENTLY_DEAD tuple is in fact dead to all observers,
but this patch does not attempt to exploit that).  The code would follow a
chain forward all the way, but then stop before a DEAD tuple when backing
up, meaning that not all of the chain got moved.  This could lead to copying
the chain multiple times (resulting in duplicate copies of the live tuple at
its end), or leaving dangling index entries behind (which, aside from
generating warnings from later vacuums, creates a risk of wrong query
results or bogus duplicate-key errors once the heap slot the index entry
points to is repopulated).

The fix is to recheck HeapTupleSatisfiesVacuum while following a chain
forward, and to stop if a DEAD tuple is reached.  Each contiguous group
of RECENTLY_DEAD tuples will therefore be copied as a separate chain.
The patch also adds a couple of extra sanity checks to verify correct
behavior.

Per report and test case from Pavan Deolasee.
2007-03-14 18:48:55 +00:00
Tom Lane 0169c354bf Arrange to install a "posixrules" entry in our timezone database, so that
POSIX-style timezone specs that don't exactly match any database entry will
be treated as having correct USA DST rules.  Also, document that this can
be changed if you want to use some other DST rules with a POSIX zone spec.

We could consider changing localtime.c's TZDEFRULESTRING, but since that
facility can only deal with one DST transition rule, it seems fairly useless
now; might as well just plan to override it using a "posixrules" entry.

Backpatch as far as 8.0.  There isn't much we can do in 7.x ... either your
libc gets it right, or it doesn't.
2007-03-14 17:38:06 +00:00
Teodor Sigaev 754148d81f Add GIN support for pg_trgm. From Guillaume Smet <guillaume.smet@gmail.com>
with minor editorization by me.

Hstore improvements
* add operation hstore ? text - excat equivalent of exist()
* remove undocumented behaviour of contains operation with NULL value
* now 'key'::text=>NULL returns '"key"=>NULL' instead of NULL
* Add GIN support for contains and exist operations
* Add GiST support for exist operatiion
* improve regression tests
2007-03-14 14:21:53 +00:00
Teodor Sigaev 15f91f2789 Add GIN support for pg_trgm. From Guillaume Smet <guillaume.smet@gmail.com>
with minor editorization by me.
2007-03-14 14:15:40 +00:00