Commit Graph

27568 Commits

Author SHA1 Message Date
Teodor Sigaev 26e6c896c9 Fix compiler warning "res may be used uninitialized in this function".
Actually, it can't but some compilers are not smart enough.
Per Peter Eisentraut gripe.
2008-11-19 10:23:21 +00:00
Peter Eisentraut 8b4da40487 Change this script to Perl 5 style. Add support for multiple refnames.
Sort the output by command name.  This previously only worked by source
file name, which doesn't always match the command name exactly.  And it
certainly won't work for multiple refnames.
2008-11-19 09:51:55 +00:00
Bruce Momjian 89ad92a216 Add "Most Common Implementation" row to high availablity table so the
table is less abstract.  Most common implementations were already
mentioned in the text.
2008-11-19 04:46:37 +00:00
Tom Lane e125e28e78 Add auto-explain contrib module for automatic logging of the plans of
slow-running queries.

Takahiro Itagaki
2008-11-19 02:59:28 +00:00
Tom Lane 31ec957a15 Fix define_custom_variable so that SUSET custom variables behave
somewhat reasonably.  It's not perfect, but it beats the kluge
proposed in the auto-explain patch ...
2008-11-19 02:07:07 +00:00
Tom Lane cd35e9d746 Some infrastructure changes for the upcoming auto-explain contrib module:
* Refactor explain.c slightly to export a convenient-to-use subroutine
for printing EXPLAIN results.

* Provide hooks for plugins to get control at ExecutorStart and ExecutorEnd
as well as ExecutorRun.

* Add some minimal support for tracking the total runtime of ExecutorRun.
This code won't actually do anything unless a plugin prods it to.

* Change the API of the DefineCustomXXXVariable functions to allow nonzero
"flags" to be specified for a custom GUC variable.  While at it, also make
the "bootstrap" default value for custom GUCs be explicitly specified as a
parameter to these functions.  This is to eliminate confusion over where the
default comes from, as has been expressed in the past by some users of the
custom-variable facility.

* Refactor GUC code a bit to ensure that a custom variable gets initialized to
something valid (like its default value) even if the placeholder value was
invalid.
2008-11-19 01:10:24 +00:00
Magnus Hagander 667685ca7d Add required include to build with cygwin.
Andrew Chernow
2008-11-18 21:17:26 +00:00
Peter Eisentraut f426fbf746 Ident authentication over Unix-domain sockets on Solaris, using
getpeerucred() function.

Author: Garick Hamlin <ghamlin@isc.upenn.edu>
2008-11-18 13:10:20 +00:00
Bruce Momjian 29ad832dba Document that Bucardo is an example of mulit-master replication with
conflict resolution.
2008-11-17 18:55:14 +00:00
Teodor Sigaev 25ca5a9a54 Replace plain-memory ordered array by binary tree in ts_stat() function.
Performance is increased from 50% up to 10^3 times depending on data.
2008-11-17 12:17:09 +00:00
Tom Lane 18004101ac Modify UPDATE/DELETE WHERE CURRENT OF to use the FOR UPDATE infrastructure to
locate the target row, if the cursor was declared with FOR UPDATE or FOR
SHARE.  This approach is more flexible and reliable than digging through the
plan tree; for instance it can cope with join cursors.  But we still provide
the old code for use with non-FOR-UPDATE cursors.  Per gripe from Robert Haas.
2008-11-16 17:34:28 +00:00
Tom Lane 30f272a79b Add missing dependencies to preproc.y build rule 2008-11-15 22:20:55 +00:00
Andrew Dunstan f30a1d0474 Add missing semicolon, per grip from Alex Hunsaker. 2008-11-15 22:18:05 +00:00
Peter Eisentraut 8aad333f8f Fix crash of xmlconcat(NULL)
also backpatched to 8.3
2008-11-15 20:52:35 +00:00
Tom Lane 0656ed3daa Make SELECT FOR UPDATE/SHARE work on inheritance trees, by having the plan
return the tableoid as well as the ctid for any FOR UPDATE targets that
have child tables.  All child tables are listed in the ExecRowMark list,
but the executor just skips the ones that didn't produce the current row.

Curiously, this longstanding restriction doesn't seem to have been documented
anywhere; so no doc changes.
2008-11-15 19:43:47 +00:00
Tom Lane 07c179a82b Document a gotcha that happens on Windows when using libpq's new event
procedure support: it's possible to get confused because exported procedures
have two different addresses.  Per Andrew Chernow.
2008-11-14 22:58:51 +00:00
Magnus Hagander 772eedb6bb Exclude contrib/intagg from the list of MSVC project files to be generated,
since it's now just a SQL module and no C code.
2008-11-14 22:12:37 +00:00
Tom Lane 5c9c08d250 One more hack to see if we can get the cygwin machines building again.
This continues the saga of trying to get PGDLLIMPORT to work in pg_crc.h
in both backend and frontend environments.
2008-11-14 21:45:07 +00:00
Tom Lane 62533d34a5 Second try at fixing DLLIMPORT problem for pg_crc.h on Cygwin. 2008-11-14 20:21:07 +00:00
Tom Lane 32cc9e5533 Reduce contrib/intagg to a thin wrapper around the new core functions
array_agg() and unnest().  We could drop it entirely in the future,
but let's keep it for a release or two as a compatibility assist.
2008-11-14 19:58:45 +00:00
Tom Lane 9e0247aba5 In CREATE AGGREGATE, allow the transition datatype to be "internal", but only
if the user is superuser.  This makes available to extension modules the same
sort of trick being practiced by array_agg().  The reason for the superuser
restriction is that you could crash the system by connecting up an
incompatible pair of internal-using functions as an aggregate.  It shouldn't
interfere with any legitimate use, since you'd have to be superuser to create
the internal-using transition and final functions anyway.
2008-11-14 19:47:50 +00:00
Tom Lane fbaa172d65 ecpg's preproc.y is now generated as needed, so remove from CVS. 2008-11-14 17:43:14 +00:00
Tom Lane 4f38b9a80a Make CREATE CONVERSION verify that a putative encoding conversion function
returns VOID.  This is the last of the easy fixes I recommended in
11870.1218838360@sss.pgh.pa.us --- the others got done awhile ago but
I forgot about this one.
2008-11-14 17:40:56 +00:00
Tom Lane 1a0bbc296c Improve comment about when to clean generated files. 2008-11-14 17:18:20 +00:00
Michael Meskes b78f9b496d Enable script to generate preproc.y in build process. 2008-11-14 17:11:40 +00:00
Michael Meskes a76e98f021 Fixed test for output_filename == stdout. 2008-11-14 16:25:34 +00:00
Heikki Linnakangas f06b7604ca Fix oversight in previous error-reporting patch; mustn't pfree path string
before passing it to elog.
2008-11-14 11:09:50 +00:00
Peter Eisentraut 6e82501083 Since doc/src/sgml already builds the HTML docs twice to resolve index
entries, we don't have to do two builds here as well.
2008-11-14 10:43:59 +00:00
Peter Eisentraut d129255077 Set SQL man pages to be section 7 by default, and only transform them to
another section if required by the platform (instead of the old way of
building them in section "l" and always transforming them to the
platform-specific section).

This speeds up the installation on common platforms, and it avoids some
funny business with the man page tools and build process.
2008-11-14 10:22:48 +00:00
Michael Meskes e339ed5f50 Added files containing changes between gram.y and preproc.y. 2008-11-14 10:03:33 +00:00
Michael Meskes 4607c5ca56 Adding script that generates preproc.y from gram.y to CVS. 2008-11-14 10:01:04 +00:00
Tom Lane 81e11f2d05 Actually, instead of whining about how type internal might not safely store
a pointer, why don't we just fix that.  Every known use of "internal" really
means a pointer anyway.
2008-11-14 02:09:52 +00:00
Alvaro Herrera 03e5248d0f Replace the usage of heap_addheader to create pg_attribute tuples with regular
heap_form_tuple.  Since this removes the last remaining caller of
heap_addheader, remove it.

Extracted from the column privileges patch from Stephen Frost, with further
code cleanups by me.
2008-11-14 01:57:42 +00:00
Tom Lane c889ebce0a Implement the basic form of UNNEST, ie unnest(anyarray) returns setof
anyelement.  This lacks the WITH ORDINALITY option, as well as the multiple
input arrays option added in the most recent SQL specs.  But it's still a
pretty useful subset of the spec's functionality, and it is enough to
allow obsoleting contrib/intagg.
2008-11-14 00:51:47 +00:00
Tom Lane 5b9453bcd3 Minor code clarity improvements in array_agg functions, and add a comment
about how this is playing fast and loose with the type system.
2008-11-14 00:12:08 +00:00
Tom Lane c23b6fa7b5 Marginal editorial improvements for array_agg patch documentation. 2008-11-13 23:01:09 +00:00
Tom Lane 312d51798f Suppress leap-second-aware timezones in the output of pg_tzenumerate_next,
and thereby in the pg_timezone_names view.  Although we allow such zones
to be used in certain limited contexts like AT TIME ZONE, we don't allow
them in SET TIME ZONE, and bug #4528 shows that they're more likely to
confuse users than do anything useful.  So hide 'em.  (Note that we don't
even generate these zones when installing our own timezone database.
But they are likely to be present when using a system-provided database.)
2008-11-13 20:49:38 +00:00
Tom Lane 10e3acb8e7 Prevent synchronous scan during GIN index build, because GIN is optimized
for inserting tuples in increasing TID order.  It's not clear whether this
fully explains Ivan Sergio Borgonovo's complaint, but simple testing
confirms that a scan that doesn't start at block 0 can slow GIN build by
a factor of three or four.

Backpatch to 8.3.  Sync scan didn't exist before that.
2008-11-13 17:42:10 +00:00
Peter Eisentraut 3379fae6de array_agg aggregate function, as per SQL:2008, but without ORDER BY clause
Rearrange the documentation a bit now that array_agg and xmlagg have similar
semantics and issues.

best of Robert Haas, Jeff Davis, Peter Eisentraut
2008-11-13 15:59:51 +00:00
Tom Lane 69a0e2f76d PGDLLIMPORT-ize the global variables referenced in pg_crc.h.
I think this will fix current mingw buildfarm failures for pg_trgm.
2008-11-13 14:42:28 +00:00
Michael Meskes 53f93cbb20 Updated parser file to the one generated by the latest version of parse.[awk|pl] from the latest version of gram.y
Some small corrections to test suite.
2008-11-13 11:54:39 +00:00
Michael Meskes cd583703ea Removed two non-terminals:
- FloatOnly: only used by NumericOnly, instead put the FloatOnly production into NumericOnly
- IntegerOnly: only used by NumericOnly and one ALTER TABLE rule, replacement SignedIconst is already used in several other places
2008-11-13 11:10:06 +00:00
Magnus Hagander c89404edf3 Fix libpq certificate validation for SSL connections.
Add config parameter "sslverify" to control the verification. Default
is to do full verification.

Clean up some old SSL code that never really worked.
2008-11-13 09:45:25 +00:00
Tom Lane e7d8bfb934 Arrange to cache the results of looking up a btree predicate proof comparison
operator.  The result depends only on the two input operators and the proof
direction (imply or refute), so it's easy to cache.  This provides a very
large savings in cases such as Sergey Konoplev's long NOT-IN-list example,
where predtest spends all its time repeatedly figuring out that the same pair
of operators cannot be used to prove anything.  (But of course the O(N^2)
behavior still catches up with you eventually.)  I'm not convinced it buys
a whole lot when constraint_exclusion isn't turned on, but it's not a lot
of added code so we might as well cache all the time.
2008-11-13 00:20:45 +00:00
Tom Lane fdf8d0624a In predtest.c, install a limit on the number of branches we will process in
AND, OR, or equivalent clauses: if there are too many (more than 100) just
exit without proving anything.  This ensures that we don't spend O(N^2) time
trying (and most likely failing) to prove anything about very long IN lists
and similar cases.

Also, install a couple of CHECK_FOR_INTERRUPTS calls to ensure that a long
proof attempt can be interrupted.

Per gripe from Sergey Konoplev.

Back-patch the whole patch to 8.2 and just the CHECK_FOR_INTERRUPTS addition
to 8.1.  (The rest of the patch doesn't apply cleanly, and since 8.1 doesn't
show the complained-of behavior anyway, it doesn't seem necessary to work
hard on it.)
2008-11-12 23:08:37 +00:00
Alvaro Herrera 249b224bf5 Update URL to Ross Williams' CRC paper.
Per note from Devrim Gunduz
2008-11-12 21:53:46 +00:00
Peter Eisentraut 2b2fb7d85d Support for man page links, if a man page has more than one refname.
We don't actually use this anywhere, but it might come in handy for dealing
with SELECT/WITH/TABLE.

It works with both the old and the new man page target (for some value of
"works").
2008-11-12 16:01:51 +00:00
Peter Eisentraut 18eeacc463 Remove unnecessary whitespace in refname elements. This confuses the
man page tools.
2008-11-12 15:53:34 +00:00
Peter Eisentraut 2655ec1f2c Add refentrytitle elements to refentry pages. Their absence confused the
man page tools somewhat.
2008-11-12 15:52:44 +00:00
Michael Meskes 9e6976057c Do not use ICONST/SCONST in rules other than Iconst/Sconst. 2008-11-12 15:50:20 +00:00