Commit Graph

27576 Commits

Author SHA1 Message Date
Tom Lane 176961c1f1 Fix breakage of bitmap scan plan creation for special index operators such
as LIKE.  I oversimplified this code when removing support for plan-time
determination of index operator lossiness back in April --- I had thought
create_bitmap_subplan could stop returning two separate lists of qual
conditions, but it still must so that we can treat special operators
correctly in create_bitmap_scan_plan.  Per report from Rushabh Lathia.
2008-11-20 19:52:54 +00:00
Magnus Hagander 6c3690d835 Don't pass strings directly to errdetail() and errhint() - use
%s to unescape them. Fixes a potential security issue (in as yet
unreleased code)
2008-11-20 15:36:22 +00:00
Magnus Hagander 284491ee71 Silence compiler warning about ignored return value. Our comment already
clearly stated that we are aware that we're ignoring it.
2008-11-20 15:03:39 +00:00
Peter Eisentraut b09a1a2942 TABLE command 2008-11-20 14:04:46 +00:00
Magnus Hagander f179d5ea99 Add support for using SSL client certificates to authenticate to the
database (only for SSL connections, obviously).
2008-11-20 11:48:26 +00:00
Magnus Hagander 3c486fbd1c Control client certificate requesting with the pg_hba option "clientcert"
instead of just relying on the root certificate file to be present.
2008-11-20 09:29:36 +00:00
Peter Eisentraut 5054867632 Add WITH as a refname to the SELECT reference page.
Now "\help WITH" works and there will be a separate WITH(7) man page.
2008-11-19 12:21:57 +00:00
Heikki Linnakangas 3396000684 Rethink the way FSM truncation works. Instead of WAL-logging FSM
truncations in FSM code, call FreeSpaceMapTruncateRel from smgr_redo. To
make that cleaner from modularity point of view, move the WAL-logging one
level up to RelationTruncate, and move RelationTruncate and all the
related WAL-logging to new src/backend/catalog/storage.c file. Introduce
new RelationCreateStorage and RelationDropStorage functions that are used
instead of calling smgrcreate/smgrscheduleunlink directly. Move the
pending rel deletion stuff from smgrcreate/smgrscheduleunlink to the new
functions. This leaves smgr.c as a thin wrapper around md.c; all the
transactional stuff is now in storage.c.

This will make it easier to add new forks with similar truncation logic,
like the visibility map.
2008-11-19 10:34:52 +00:00
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