Commit Graph

30620 Commits

Author SHA1 Message Date
Robert Haas 262c1a42dc Unbreak comments on composite type attributes.
Report and diagnosis by Peter Eisentraut.
2010-10-19 07:21:58 -04:00
Bruce Momjian 9df96f9bb1 In pg_upgrade, rename macro EXEC_EXT to SHELL_EXT for clarity.
Backpatch to 9.0.X.
2010-10-19 02:56:16 +00:00
Peter Eisentraut bc8624b15d Support key word 'all' in host column of pg_hba.conf 2010-10-18 22:15:44 +03:00
Bruce Momjian 433c7a6545 Document the tablespace directory "should" be empty, rather than "must"
be empty.  Because of binary migration usage, it might not be empty.
2010-10-18 18:15:58 +00:00
Robert Haas 9c73e20f38 Change example pg_hba.conf in docs to match altered pg_hba.conf.sample
Peter Eisentraut's recent patch to allow host names in pg_hba.conf
changed the contents of pg_hba.conf.sample

Fujii Masao
2010-10-18 12:18:45 -04:00
Tom Lane 419d2374bf Fix a passel of inappropriately-named global functions in GIN.
The GIN code has absolutely no business exporting GIN-specific functions
with names as generic as compareItemPointers() or newScanKey(); that's
just trouble waiting to happen.  I got annoyed about this again just now
and decided to fix it.  This commit ensures that all global symbols
defined in access/gin/ have names including "gin" or "Gin".  There were a
couple of cases, like names involving "PostingItem", where arguably the
names were already sufficiently nongeneric; but I figured as long as I was
risking creating merge problems for unapplied GIN patches I might as well
impose a uniform policy.

I didn't touch any static symbol names.  There might be some places
where it'd be appropriate to rename some static functions to match
siblings that are exported, but I'll leave that for another time.
2010-10-17 21:43:26 -04:00
Tom Lane 48c7d9f6ff Improve GIN indexscan cost estimation.
The better estimate requires more statistics than we previously stored:
in particular, counts of "entry" versus "data" pages within the index,
as well as knowledge of the number of distinct key values.  We collect
this information during initial index build and update it during VACUUM,
storing the info in new fields on the index metapage.  No initdb is
required because these fields will read as zeroes in a pre-existing
index, and the new gincostestimate code is coded to behave (reasonably)
sanely if they are zeroes.

Teodor Sigaev, reviewed by Jan Urbanski, Tom Lane, and Itagaki Takahiro.
2010-10-17 20:52:32 -04:00
Magnus Hagander cd0e825321 Fix msvc build for localized versions of Visual C++
Look only at the non-localized part of the output from "vcbuild /?",
which is used to determine the version of Visual Studio in use. Different
languages seem to localize different amounts of the string, but we assume
the part "Microsoft Visual C++" won't be modified.
2010-10-17 16:36:54 +02:00
Tom Lane 9771125c18 Fix recent changes to not break non-IPV6-aware systems. 2010-10-16 10:12:16 -04:00
Alvaro Herrera 33ae03f400 Document that translate() removes characters in "from" that don't have
a corresponding "to" character.

Author: Josh Kupershmidt
2010-10-16 01:15:10 -03:00
Tom Lane 07f1264dda Allow WITH clauses to be attached to INSERT, UPDATE, DELETE statements.
This is not the hoped-for facility of using INSERT/UPDATE/DELETE inside
a WITH, but rather the other way around.  It seems useful in its own
right anyway.

Note: catversion bumped because, although the contents of stored rules
might look compatible, there's actually a subtle semantic change.
A single Query containing a WITH and INSERT...VALUES now represents
writing the WITH before the INSERT, not before the VALUES.  While it's
not clear that that matters to anyone, it seems like a good idea to
have it cited in the git history for catversion.h.

Original patch by Marko Tiikkaja, with updating and cleanup by
Hitoshi Harada.
2010-10-15 19:55:25 -04:00
Peter Eisentraut 6ab42ae367 Support host names in pg_hba.conf
Peter Eisentraut, reviewed by KaiGai Kohei and Tom Lane
2010-10-15 22:56:18 +03:00
Peter Eisentraut 3cde44374a Change references to SQL/XML:2003 to :2008 and renumber sections accordingly 2010-10-15 22:56:18 +03:00
Tom Lane 71d24466fb Document the DISTINCT noise word in the UNION/INTERSECT/EXCEPT constructs.
I also rearranged the order of the sections to match the logical order
of processing steps: the distinct-elimination implied by SELECT DISTINCT
happens before, not after, any UNION/INTERSECT/EXCEPT combination.

Per a suggestion from Hitoshi Harada.
2010-10-15 15:48:45 -04:00
Alvaro Herrera 0c9b166db5 Allow pg_ctl to register the service in either AUTO or DEMAND start type
Author: Quan Zongliang
Documentation updates by David Fetter
2010-10-15 14:30:03 -03:00
Magnus Hagander 0e7f7071e8 Fix low-risk potential denial of service against RADIUS login.
Corrupt RADIUS responses were treated as errors and not ignored
(which the RFC2865 states they should be). This meant that a
user with unfiltered access to the network of the PostgreSQL
or RADIUS server could send a spoofed RADIUS response
to the PostgreSQL server causing it to reject a valid login,
provided the attacker could also guess (or brute-force) the
correct port number.

Fix is to simply retry the receive in a loop until the timeout
has expired or a valid (signed by the correct RADIUS server)
packet arrives.

Reported by Alan DeKok in bug #5687.
2010-10-15 16:59:10 +02:00
Simon Riggs 915116bc62 Correct WAL space calculation formula in docs.
Error pointed out by Fujii Masao, though not his patch.
2010-10-15 10:17:12 +01:00
Bruce Momjian 23177114c6 Improve comment about ignoring 128 error code on Windows:
* Microsoft reports it is related to mutex failure:
     *   http://archives.postgresql.org/pgsql-hackers/2010-09/msg00790.php
2010-10-15 01:58:11 +00:00
Robert Haas e468213358 Add pg_user_mappings to the table of system views. 2010-10-14 19:13:01 -04:00
Tom Lane 11cad29c91 Support MergeAppend plans, to allow sorted output from append relations.
This patch eliminates the former need to sort the output of an Append scan
when an ordered scan of an inheritance tree is wanted.  This should be
particularly useful for fast-start cases such as queries with LIMIT.

Original patch by Greg Stark, with further hacking by Hans-Jurgen Schonig,
Robert Haas, and Tom Lane.
2010-10-14 16:57:57 -04:00
Peter Eisentraut 30e749dece Fix makefile logic to not break the build when xgettext is missing
xgettext is only required when make init-po is run manually; it is not
required for a build.  The intent to handle that was already there, but
the ifdef's were in the wrong place.
2010-10-14 23:16:46 +03:00
Peter Eisentraut 402e11913f Remove reference.ced
This is a parsed DocBook DTD for the PSGML Emacs mode, but it hasn't
been updated since we switched to DocBook 4.2 about seven years ago.
Also, PSGML has deprecated this method of DTD parsing.
2010-10-14 23:16:46 +03:00
Peter Eisentraut 9f2d7f6e2d Complete the documentation of the USAGE privilege for foreign servers
The GRANT reference page failed to mention that the USAGE privilege
allows modifying associated user mappings, although this was already
documented on the CREATE/ALTER/DROP USER MAPPING pages.
2010-10-14 23:16:46 +03:00
Peter Eisentraut 80ada4c0db Document (compositeval).* field selection syntax 2010-10-14 23:16:46 +03:00
Simon Riggs 7085891784 Improvements to docs about pg_archive_cleanup and use of archives
Brendan Jurd
2010-10-14 19:30:15 +01:00
Simon Riggs 3bbcc5c999 Make startup process respond to signals to cancel waiting on latch.
A tidy up for recently committed changes to startup latch.

Fujii Masao
2010-10-14 19:15:26 +01:00
Simon Riggs 45cd9199c2 Fix bug in comment of timeline history file.
Fujii Masao
2010-10-14 19:06:06 +01:00
Michael Meskes 816b008eaf Applied patch by Itagaki Takahiro to fix incorrect status calculation in
ecpglib. Instead of parsing the statement just as ask the database server. This
patch removes the whole client side track keeping of the current transaction
status.
2010-10-14 17:55:07 +02:00
Peter Eisentraut 1a996d6c29 Remove executable permission from files where it doesn't belong 2010-10-13 22:30:25 +03:00
Peter Eisentraut e8a47b3cb9 Add index entries for pg_stat* views 2010-10-13 21:29:10 +03:00
Peter Eisentraut ceb5b787c6 Mention the default pg_ctl wait time in the -t option documentation 2010-10-13 20:24:51 +03:00
Peter Eisentraut ef204db577 Make title capitalization consistent with surroundings 2010-10-13 20:05:16 +03:00
Peter Eisentraut 3bf79839c8 Put per-letter quicklinks at the top of the HTML bookindex page 2010-10-13 19:46:05 +03:00
Itagaki Takahiro d0f876ca8c Accept 'public' as a pseudo-role name in has_table_privilege() and friends
to see if a particular privilege has been granted to PUBLIC.

The issue was reported by Jim Nasby.
Patch by Alvaro Herrera, and reviewed by KaiGai Kohei.
2010-10-13 14:37:23 +09:00
Tom Lane f4d242ef94 Remove some unnecessary tests of pgstat_track_counts.
We may as well make pgstat_count_heap_scan() and related macros just count
whenever rel->pgstat_info isn't null.  Testing pgstat_track_counts buys
nothing at all in the normal case where that flag is ON; and when it's OFF,
the pgstat_info link will be null, so it's still a useless test.

This change is unlikely to buy any noticeable performance improvement,
but a cycle shaved is a cycle earned; and my investigations earlier today
convinced me that we're down to the point where individual instructions in
the inner execution loops are starting to matter.
2010-10-12 14:44:25 -04:00
Alvaro Herrera 82659e0456 Fix typo 2010-10-12 13:24:10 -03:00
Tom Lane 09130e5867 Fix plpython so that it again honors typmod while assigning to tuple fields.
This was broken in 9.0 while improving plpython's conversion behavior for
bytea and boolean.  Per bug report from maizi.
2010-10-11 22:16:40 -04:00
Tom Lane 4016bdef8a Fix assorted bugs in GIN's WAL replay logic.
The original coding was quite sloppy about handling the case where
XLogReadBuffer fails (because the page has since been deleted).  This
would result in either "bad buffer id: 0" or an Assert failure during
replay, if indeed the page were no longer there.  In a couple of places
it also neglected to check whether the change had already been applied,
which would probably result in corrupted index contents.  I believe that
bug #5703 is an instance of the first problem.  These issues could show up
without replication, but only if you were unfortunate enough to crash
between modification of a GIN index and the next checkpoint.

Back-patch to 8.2, which is as far back as GIN has WAL support.
2010-10-11 19:04:37 -04:00
Tom Lane 220e45bf32 Improve the planner's simplification of NOT constructs.
This patch merges the responsibility for NOT-flattening into
eval_const_expressions' processing.  It wasn't done that way originally
because prepqual.c is far older than eval_const_expressions.  But putting
this work into eval_const_expressions saves one pass over the qual trees,
and in fact saves even more than that because we can exploit the knowledge
that the subexpressions have already been recursively simplified.  Doing it
this way also lets us do it uniformly over all expressions, whereas
prepqual.c formerly just did it at top level to save cycles.  That should
improve the planner's ability to recognize logically-equivalent constructs.

While at it, also add the ability to fold a NOT into BooleanTest and
NullTest constructs (the latter only for the scalar-datatype case).

Per discussion of bug #5702.
2010-10-10 23:19:50 -04:00
Tom Lane b48b9cb3a4 Teach psql to do tab completion for names of psql variables.
Completion is supported in the context of \set and when interpolating
a variable value using :foo etc.

In passing, fix some places in tab-complete.c that weren't following
project style for comment formatting.

Pavel Stehule, reviewed by Itagaki Takahiro
2010-10-10 18:42:35 -04:00
Tom Lane 2ec993a7cb Support triggers on views.
This patch adds the SQL-standard concept of an INSTEAD OF trigger, which
is fired instead of performing a physical insert/update/delete.  The
trigger function is passed the entire old and/or new rows of the view,
and must figure out what to do to the underlying tables to implement
the update.  So this feature can be used to implement updatable views
using trigger programming style rather than rule hacking.

In passing, this patch corrects the names of some columns in the
information_schema.triggers view.  It seems the SQL committee renamed
them somewhere between SQL:99 and SQL:2003.

Dean Rasheed, reviewed by Bernd Helmle; some additional hacking by me.
2010-10-10 13:45:07 -04:00
Peter Eisentraut f7b15b5098 Extensive ECPG documentation improvements
Satoshi Nagayasu, reviewed and revised by Peter Eisentraut

Since this introduces new refentries that we probably don't want to publish as
man pages, tweak man page stylesheet to omit man pages without manvolnum
element.

Peter Eisentraut
2010-10-10 13:46:02 +03:00
Robert Haas ab6d9f1641 Adjust EXPLAIN documentation, so that it's not unreasonably wide.
The new formatting matches what we do for COPY.

Per a complaint from Bruce Momjian.
2010-10-08 22:59:48 -04:00
Bruce Momjian f7dbddac69 Single-word clarification in postgresql.conf log_truncate_on_rotation
comment.
2010-10-08 19:10:21 +00:00
Tom Lane caaf2e8469 Fix sloppy usage of TRIGGER_FIRED_BEFORE/TRIGGER_FIRED_AFTER.
Various places were testing TRIGGER_FIRED_BEFORE() where what they really
meant was !TRIGGER_FIRED_AFTER(), or vice versa.  This needs to be cleaned
up because there are about to be more than two possible states.

We might want to note this in the 9.1 release notes as something for
trigger authors to double-check.

For consistency's sake I also changed some places that assumed that
TRIGGER_FIRED_FOR_ROW and TRIGGER_FIRED_FOR_STATEMENT are necessarily
mutually exclusive; that's not in immediate danger of breaking, but
it's still sloppier than it should be.

Extracted from Dean Rasheed's patch for triggers on views.  I'm committing
this separately since it's an identifiable separate issue, and is the
only reason for the patch to touch most of these particular files.
2010-10-08 13:27:31 -04:00
Robert Haas 56ccff5980 Warn that views can be safely used to hide columns, but not rows. 2010-10-08 09:15:17 -04:00
Tom Lane 9cc8c84e73 Improve logging in VACUUM FULL VERBOSE and CLUSTER VERBOSE.
This patch resurrects some of the information that could be logged by the
old, now-dead implementation of VACUUM FULL, in particular counts of live
and dead tuples and the time taken for the table rebuild proper.  There's
still no logging about the ensuing index rebuilds, though.

Itagaki Takahiro
2010-10-07 21:46:46 -04:00
Tom Lane 26a7b48e10 Eliminate some repetitive coding in tuplesort.c.
Use a macro LogicalTapeReadExact() to encapsulate the error check when
we want to read an exact number of bytes from a "tape".  Per a suggestion
of Takahiro Itagaki.
2010-10-07 20:32:21 -04:00
Tom Lane 3ba11d3df2 Teach CLUSTER to use seqscan-and-sort when it's faster than indexscan.
... or at least, when the planner's cost estimates say it will be faster.

Leonardo Francalanci, reviewed by Itagaki Takahiro and Tom Lane
2010-10-07 20:00:28 -04:00
Robert Haas 694c56af2b Improve WAL reliability documentation, and add more cross-references to it.
In particular, we are now more explicit about the fact that you may need
wal_sync_method=fsync_writethrough for crash-safety on some platforms,
including MaxOS X.  There's also now an explicit caution against assuming
that the default setting of wal_sync_method is either crash-safe or best
for performance.
2010-10-07 12:22:00 -04:00