]> granicus.if.org Git - postgresql/log
postgresql
14 years agoMake psql distinguish between unique indices and unique constraints.
Robert Haas [Sun, 1 Aug 2010 01:08:29 +0000 (01:08 +0000)]
Make psql distinguish between unique indices and unique constraints.

Josh Kupershmidt.  Reviewing and kibitzing by Kevin Grittner and me.

14 years agoTweak tsmatchsel() so that it examines the structure of the tsquery whenever
Tom Lane [Sat, 31 Jul 2010 03:27:40 +0000 (03:27 +0000)]
Tweak tsmatchsel() so that it examines the structure of the tsquery whenever
possible (ie, whenever the tsquery is a constant), even when no statistics
are available for the tsvector.  For example, foo @@ 'a & b'::tsquery
can be expected to be more selective than foo @@ 'a'::tsquery, whether
or not we know anything about foo.  We use DEFAULT_TS_MATCH_SEL as the assumed
selectivity of individual query terms when no stats are available, then
combine the terms according to the query's AND/OR structure as usual.

Per experimentation with Artur Dabrowski's example.  (The fact that there
are no stats available in that example is a problem in itself, but
nonetheless tsmatchsel should be smarter about the case.)

Back-patch to 8.4 to keep all versions of tsmatchsel() in sync.

14 years agoRewrite the key-combination logic in GIN's keyGetItem() and scanGetItem()
Tom Lane [Sat, 31 Jul 2010 00:30:54 +0000 (00:30 +0000)]
Rewrite the key-combination logic in GIN's keyGetItem() and scanGetItem()
routines to make them behave better in the presence of "lossy" index pointers.
The previous coding was outright incorrect for some cases, as recently
reported by Artur Dabrowski: scanGetItem would fail to return index entries in
cases where one index key had multiple exact pointers on the same page as
another key had a lossy pointer.  Also, keyGetItem was extremely inefficient
for cases where a single index key generates multiple "entry" streams, such as
an @@ operator with a multiple-clause tsquery.  The presence of a lossy page
pointer in any one stream defeated its ability to use the opclass
consistentFn, resulting in probing many heap pages that didn't really need to
be visited.  In Artur's example case, a query like
WHERE tsvector @@ to_tsquery('a & b')
was about 50X slower than the theoretically equivalent
WHERE tsvector @@ to_tsquery('a') AND tsvector @@ to_tsquery('b')
The way that I chose to fix this was to have GIN call the consistentFn
twice with both TRUE and FALSE values for the in-doubt entry stream,
returning a hit if either call produces TRUE, but not if they both return
FALSE.  The code handles this for the case of a single in-doubt entry stream,
but punts (falling back to the stupid behavior) if there's more than one lossy
reference to the same page.  The idea could be scaled up to deal with multiple
lossy references, but I think that would probably be wasted complexity.  At
least to judge by Artur's example, such cases don't occur often enough to be
worth trying to optimize.

Back-patch to 8.4.  8.3 did not have lossy GIN index pointers, so not
subject to these problems.

14 years agoMake details of the Numeric representation private to numeric.c.
Robert Haas [Fri, 30 Jul 2010 04:30:23 +0000 (04:30 +0000)]
Make details of the Numeric representation private to numeric.c.

Review by Tom Lane.

14 years agoImproved version of patch to protect pg_get_expr() against misuse:
Tom Lane [Thu, 29 Jul 2010 23:16:33 +0000 (23:16 +0000)]
Improved version of patch to protect pg_get_expr() against misuse:
look through join alias Vars to avoid breaking join queries, and
move the test to someplace where it will catch more possible ways
of calling a function.  We still ought to throw away the whole thing
in favor of a data-type-based solution, but that's not feasible in
the back branches.

This needs to be back-patched further than 9.0, but I don't have time
to do so today.  Committing now so that the fix gets into 9.0beta4.

14 years agoRename asyncCommitLSN to asyncXactLSN to reflect changed role in 9.0.
Simon Riggs [Thu, 29 Jul 2010 22:27:27 +0000 (22:27 +0000)]
Rename asyncCommitLSN to asyncXactLSN to reflect changed role in 9.0.
Transaction aborts now record their LSN to avoid corner case
behaviour in SR/HS, hence change of name of variables and functions.
As pointed out by Fujii Masao. Cosmetic changes only.

14 years agoUpdate release notes for 9.0 beta 4. Back-patch some changes that were made only...
Tom Lane [Thu, 29 Jul 2010 21:18:11 +0000 (21:18 +0000)]
Update release notes for 9.0 beta 4.  Back-patch some changes that were made only in HEAD.

14 years agoAvoid using text_to_cstring() in levenshtein functions.
Robert Haas [Thu, 29 Jul 2010 20:11:48 +0000 (20:11 +0000)]
Avoid using text_to_cstring() in levenshtein functions.

Operating directly on the underlying varlena saves palloc and memcpy
overhead, which testing shows to be significant.

Extracted from a larger patch by Alexander Korotkov.

14 years agoClean up some inconsistencies in the volatility marking of various I/O
Tom Lane [Thu, 29 Jul 2010 20:09:25 +0000 (20:09 +0000)]
Clean up some inconsistencies in the volatility marking of various I/O
related functions.  Per today's discussion, we will henceforth assume
that datatype I/O functions are either stable or immutable, never volatile.
(This implies in particular that domain CHECK constraint expressions shouldn't
be volatile, since domain_in executes them.)  In turn, functions that execute
the I/O functions of arbitrary datatypes should always be labeled stable.
This affects the labeling of array_to_string, which was unsafely marked
immutable, and record_in, record_out, record_recv, record_send,
domain_in, domain_recv, which were over-conservatively marked volatile.
The array I/O functions were already marked stable, which is correct
per this policy but would have been wrong if we maintained domain_in
as volatile.

Back-patch to 9.0, along with an earlier fix to correctly mark cash_in
and cash_out as stable not immutable (since they depend on lc_monetary).

No catversion bump --- the implications of this are not currently
severe enough to justify a forced initdb.

14 years agoFix indentation of verbatim block elements
Peter Eisentraut [Thu, 29 Jul 2010 19:34:41 +0000 (19:34 +0000)]
Fix indentation of verbatim block elements

Block elements with verbatim formatting (literallayout, programlisting,
screen, synopsis) should be aligned at column 0 independent of the surrounding
SGML, because whitespace is significant, and indenting them creates erratic
whitespace in the output.  The CSS stylesheets already take care of indenting
the output.

Assorted markup improvements to go along with it.

14 years agoFix another longstanding problem in copy_relation_data: it was blithely
Tom Lane [Thu, 29 Jul 2010 19:23:20 +0000 (19:23 +0000)]
Fix another longstanding problem in copy_relation_data: it was blithely
assuming that a local char[] array would be aligned on at least a word
boundary.  There are architectures on which that is pretty much guaranteed to
NOT be the case ... and those arches also don't like non-aligned memory
accesses, meaning that log_newpage() would crash if it ever got invoked.
Even on Intel-ish machines there's a potential for a large performance penalty
from doing I/O to an inadequately aligned buffer.  So palloc it instead.

Backpatch to 8.0 --- 7.4 doesn't have this code.

14 years agoWork around a documentation toolchain problem by replacing the "AIX-fixlevels"
Tom Lane [Thu, 29 Jul 2010 18:29:52 +0000 (18:29 +0000)]
Work around a documentation toolchain problem by replacing the "AIX-fixlevels"
table with a <variablelist> carrying the same information.  Previously the
9.0 documentation was failing to build as a US-size PDF file.  It's quite
obscure what the real problem is or why this avoids it, but we need a hack
now so we can build docs for beta4.

In passing do a bit of editing in the AIX installation docs, in particular
remove a long-obsolete claim that the regression tests are likely to fail.

14 years agoFix possible page corruption by ALTER TABLE .. SET TABLESPACE.
Robert Haas [Thu, 29 Jul 2010 16:14:36 +0000 (16:14 +0000)]
Fix possible page corruption by ALTER TABLE .. SET TABLESPACE.

If a zeroed page is present in the heap, ALTER TABLE .. SET TABLESPACE will
set the LSN and TLI while copying it, which is wrong, and heap_xlog_newpage()
will do the same thing during replay, so the corruption propagates to any
standby.  Note, however, that the bug can't be demonstrated unless archiving
is enabled, since in that case we skip WAL logging altogether, and the LSN/TLI
are not set.

Back-patch to 8.0; prior releases do not have tablespaces.

Analysis and patch by Jeff Davis.  Adjustments for back-branches and minor
wordsmithing by me.

14 years agoAdd explicit regression tests for ALTER TABLE lock levels.
Simon Riggs [Thu, 29 Jul 2010 11:06:34 +0000 (11:06 +0000)]
Add explicit regression tests for ALTER TABLE lock levels.
Use this to catch a couple of lock level assignments that slipped
through manual testing, per Peter Eisentraut.

14 years agoRemove wildly obsolete type attribute externallength from chkpass
Peter Eisentraut [Wed, 28 Jul 2010 20:34:34 +0000 (20:34 +0000)]
Remove wildly obsolete type attribute externallength from chkpass

14 years agoFix oversight in new EvalPlanQual logic: the second loop over the ExecRowMark
Tom Lane [Wed, 28 Jul 2010 17:21:56 +0000 (17:21 +0000)]
Fix oversight in new EvalPlanQual logic: the second loop over the ExecRowMark
list in ExecLockRows() forgot to allow for the possibility that some of the
rowmarks are for child tables that aren't relevant to the current row.
Per report from Kenichiro Tanaka.

14 years agoReduce lock levels of CREATE TRIGGER and some ALTER TABLE, CREATE RULE actions.
Simon Riggs [Wed, 28 Jul 2010 05:22:24 +0000 (05:22 +0000)]
Reduce lock levels of CREATE TRIGGER and some ALTER TABLE, CREATE RULE actions.
Avoid hard-coding lockmode used for many altering DDL commands, allowing easier
future changes of lock levels. Implementation of initial analysis on DDL
sub-commands, so that many lock levels are now at ShareUpdateExclusiveLock or
ShareRowExclusiveLock, allowing certain DDL not to block reads/writes.
First of number of planned changes in this area; additional docs required
when full project complete.

14 years agoFix potential failure when hashing the output of a subplan that produces
Tom Lane [Wed, 28 Jul 2010 04:50:50 +0000 (04:50 +0000)]
Fix potential failure when hashing the output of a subplan that produces
a pass-by-reference datatype with a nontrivial projection step.
We were using the same memory context for the projection operation as for
the temporary context used by the hashtable routines in execGrouping.c.
However, the hashtable routines feel free to reset their temp context at
any time, which'd lead to destroying input data that was still needed.
Report and diagnosis by Tao Ma.

Back-patch to 8.1, where the problem was introduced by the changes that
allowed us to work with "virtual" tuples instead of materializing intermediate
tuple values everywhere.  The earlier code looks quite similar, but it doesn't
suffer the problem because the data gets copied into another context as a
result of having to materialize ExecProject's output tuple.

14 years agoShow psql timing output even in quiet mode
Peter Eisentraut [Wed, 28 Jul 2010 04:39:14 +0000 (04:39 +0000)]
Show psql timing output even in quiet mode

These two settings ought to be independent of each other.

14 years agoAdd ssl_cipher() and ssl_version() functions to contrib/sslinfo.
Robert Haas [Tue, 27 Jul 2010 23:43:42 +0000 (23:43 +0000)]
Add ssl_cipher() and ssl_version() functions to contrib/sslinfo.

Review by Dave Page.

14 years agoFix typo in PL/pgsql code example.
Robert Haas [Tue, 27 Jul 2010 20:02:06 +0000 (20:02 +0000)]
Fix typo in PL/pgsql code example.

Backpatch to 8.4.

Marc Cousin.  Review by Kevin Grittner.

14 years agoSpelling fixes
Peter Eisentraut [Tue, 27 Jul 2010 19:01:16 +0000 (19:01 +0000)]
Spelling fixes

14 years agoIn postgresql.conf.sample, use on/off rather than true/false.
Robert Haas [Tue, 27 Jul 2010 16:06:53 +0000 (16:06 +0000)]
In postgresql.conf.sample, use on/off rather than true/false.

We used to be consistent about this, but my recent patch to add a
restart_after_crash GUC failed to follow the existing convention.

Report and patch from Fujii Masao.

14 years agoEnsure $_SHARED is declared in the main:: namespace, per bugs #5570 and #5571.
Alvaro Herrera [Tue, 27 Jul 2010 04:18:28 +0000 (04:18 +0000)]
Ensure $_SHARED is declared in the main:: namespace, per bugs #5570 and #5571.

Author: Alex Hunsaker

14 years agoFix grammar
Peter Eisentraut [Mon, 26 Jul 2010 20:28:49 +0000 (20:28 +0000)]
Fix grammar

backpatched to 8.1

14 years agoAdd table creation and population to example
Peter Eisentraut [Mon, 26 Jul 2010 20:14:05 +0000 (20:14 +0000)]
Add table creation and population to example

from John Gage

14 years agoRemove tabs from sgml file.
Bruce Momjian [Mon, 26 Jul 2010 01:43:52 +0000 (01:43 +0000)]
Remove tabs from sgml file.

14 years agoCREATE TABLE IF NOT EXISTS.
Robert Haas [Sun, 25 Jul 2010 23:21:22 +0000 (23:21 +0000)]
CREATE TABLE IF NOT EXISTS.

Reviewed by Bernd Helmle.

14 years agoAdd INSERT statement to example so that it can be reproduced
Peter Eisentraut [Sun, 25 Jul 2010 08:30:42 +0000 (08:30 +0000)]
Add INSERT statement to example so that it can be reproduced

from John Gage

14 years agoAdjust check_for_isn_and_int8_passing_mismatch() so it is called for all
Bruce Momjian [Sun, 25 Jul 2010 03:47:29 +0000 (03:47 +0000)]
Adjust check_for_isn_and_int8_passing_mismatch() so it is called for all
migrations.

Backpatch to 9.0.

14 years agoPrevent pg_upgrade from migrating databases that use reg* data types
Bruce Momjian [Sun, 25 Jul 2010 03:28:32 +0000 (03:28 +0000)]
Prevent pg_upgrade from migrating databases that use reg* data types
where the oid is not preserved by pg_upgrade (everything but pg_type).
Update documentation.

Per bug report from depstein@alliedtesting.com.

14 years agoFix typo
Peter Eisentraut [Sat, 24 Jul 2010 16:46:57 +0000 (16:46 +0000)]
Fix typo

14 years agoTidy up boolean data type page
Peter Eisentraut [Sat, 24 Jul 2010 12:17:35 +0000 (12:17 +0000)]
Tidy up boolean data type page

by Thom Brown

14 years agoRemove tab from SGML file
Peter Eisentraut [Sat, 24 Jul 2010 12:16:20 +0000 (12:16 +0000)]
Remove tab from SGML file

14 years agoAdd more checks against altering typed tables
Peter Eisentraut [Fri, 23 Jul 2010 20:04:18 +0000 (20:04 +0000)]
Add more checks against altering typed tables

- Prohibit altering column type
- Prohibit changing inheritance
- Move checks from Exec to Prep phases in ALTER TABLE code

backpatched to 9.0

14 years agoHave psql avoid describing local sockets as host names.
Robert Haas [Fri, 23 Jul 2010 14:56:54 +0000 (14:56 +0000)]
Have psql avoid describing local sockets as host names.

We now use the phrase 'via local socket in' rather than 'on host' in both
\c and \conninfo output, when applicable.

Fujii Masao, with some kibitzing by me.

14 years agoAvoid deep recursion when assigning XIDs to multiple levels of subxacts.
Robert Haas [Fri, 23 Jul 2010 00:43:00 +0000 (00:43 +0000)]
Avoid deep recursion when assigning XIDs to multiple levels of subxacts.

Backpatch to 8.0.

Andres Freund, with cleanup and adjustment for older branches by me.

14 years agoAdd missing function prototype.
Robert Haas [Thu, 22 Jul 2010 13:03:11 +0000 (13:03 +0000)]
Add missing function prototype.

Fujii Masao

14 years agoFix bogus server version in pg_dumpall --quote-all-identifiers.
Robert Haas [Thu, 22 Jul 2010 01:25:01 +0000 (01:25 +0000)]
Fix bogus server version in pg_dumpall --quote-all-identifiers.

14 years agoAdd options to force quoting of all identifiers.
Robert Haas [Thu, 22 Jul 2010 01:22:35 +0000 (01:22 +0000)]
Add options to force quoting of all identifiers.

I've added a quote_all_identifiers GUC which affects the behavior
of the backend, and a --quote-all-identifiers argument to pg_dump
and pg_dumpall which sets the GUC and also affects the quoting done
internally by those applications.

Design by Tom Lane; review by Alex Hunsaker; in response to bug #5488
filed by Hartmut Goebel.

14 years agoCentralize DML permissions-checking logic.
Robert Haas [Thu, 22 Jul 2010 00:47:59 +0000 (00:47 +0000)]
Centralize DML permissions-checking logic.

Remove bespoke code in DoCopy and RI_Initial_Check, which now instead
fabricate call ExecCheckRTPerms with a manufactured RangeTblEntry.
This is intended to make it feasible for an enhanced security provider
to actually make use of ExecutorCheckPerms_hook, but also has the
advantage that RI_Initial_Check can allow use of the fast-path when
column-level but not table-level permissions are present.

KaiGai Kohei.  Reviewed (in an earlier version) by Stephen Frost, and by me.
Some further changes to the comments by me.

14 years agoCVS test: please ignore
Bruce Momjian [Tue, 20 Jul 2010 18:38:53 +0000 (18:38 +0000)]
CVS test:  please ignore

Does modification just of CVS tag text cause an empty CVS diff for the commit?

14 years agoProperly replay CREATE TABLESPACE during crash recovery by deleting
Bruce Momjian [Tue, 20 Jul 2010 18:14:16 +0000 (18:14 +0000)]
Properly replay CREATE TABLESPACE during crash recovery by deleting
directory/symlink before creation.

Report from Tom Lane.

Backpatch to 9.0.

14 years agoHave \conninfo mention the port even for local sockets.
Robert Haas [Tue, 20 Jul 2010 14:14:30 +0000 (14:14 +0000)]
Have \conninfo mention the port even for local sockets.

Per discussion with David Christensen, there can be multiple
instances of PG accessible via local sockets, and you need the port
to see which one you're actually connected to.  David's original
patch worked this way, but I inadvertently ripped it out during
commit.

14 years agoAdd \conninfo command to psql, to show current connection info.
Robert Haas [Tue, 20 Jul 2010 03:54:19 +0000 (03:54 +0000)]
Add \conninfo command to psql, to show current connection info.

David Christensen. Reviewed by Steve Singer.  Some further changes by me.

14 years agoMake ECPG regression tests independent of standard_conforming_strings.
Robert Haas [Tue, 20 Jul 2010 01:57:19 +0000 (01:57 +0000)]
Make ECPG regression tests independent of standard_conforming_strings.

Per buildfarm, again.

14 years agoMake hstore regression tests independent of standard_conforming_strings.
Robert Haas [Tue, 20 Jul 2010 01:22:52 +0000 (01:22 +0000)]
Make hstore regression tests independent of standard_conforming_strings.

Per buildfarm.

14 years agoAdd restart_after_crash GUC.
Robert Haas [Tue, 20 Jul 2010 00:47:53 +0000 (00:47 +0000)]
Add restart_after_crash GUC.

Normally, we automatically restart after a backend crash, but in some
cases when PostgreSQL is invoked by clusterware it may be desirable to
suppress this behavior, so we provide an option which does this.
Since no existing GUC group quite fits, create a new group called
"error handling options" for this and the previously undocumented GUC
exit_on_error, which is now documented.

Review by Fujii Masao.

14 years agoChange the default value of standard_conforming_strings to on.
Robert Haas [Tue, 20 Jul 2010 00:34:44 +0000 (00:34 +0000)]
Change the default value of standard_conforming_strings to on.

This change should be publicized to driver maintainers at once and
release-noted as an incompatibility with previous releases.

14 years agoPortability fixes for Solaris for requirepeer feature patch
Peter Eisentraut [Mon, 19 Jul 2010 18:53:25 +0000 (18:53 +0000)]
Portability fixes for Solaris for requirepeer feature patch

per report from Dave Page

14 years agoRemove unnecessary "Not safe to send CSV data" complaint from elog.c's fallback
Tom Lane [Sun, 18 Jul 2010 23:43:32 +0000 (23:43 +0000)]
Remove unnecessary "Not safe to send CSV data" complaint from elog.c's fallback
path when CSV logging is configured but not yet operational.  It's sufficient
to send the message to stderr, as we were already doing, and the "Not safe"
gripe has already confused at least two core members ...

Backpatch to 9.0, but not further --- doesn't seem appropriate to change
this behavior in stable branches.

14 years agoAllow ORDER BY/GROUP BY/etc items to match targetlist items regardless of
Tom Lane [Sun, 18 Jul 2010 19:37:49 +0000 (19:37 +0000)]
Allow ORDER BY/GROUP BY/etc items to match targetlist items regardless of
any implicit casting previously applied to the targetlist item.  This is
reasonable because the implicit cast, by definition, wasn't written by the
user; so we are preserving the expected behavior that ORDER BY items match
textually equivalent tlist items.  The case never arose before because there
couldn't be any implicit casting of a top-level SELECT item before we process
ORDER BY etc.  But now it can arise in the context of aggregates containing
ORDER BY clauses, since the "targetlist" is the already-casted list of
arguments for the aggregate.  The net effect is that the datatype used for
ORDER BY/DISTINCT purposes is the aggregate's declared input type, not that
of the original input column; which is a bit debatable but not horrendous,
and to do otherwise would require major rework that doesn't seem justified.

Per bug #5564 from Daniel Grace.  Back-patch to 9.0 where aggregate ORDER BY
was implemented.

14 years agoFix up poor handling of unsupported-platform case in requirepeer patch.
Tom Lane [Sun, 18 Jul 2010 17:08:11 +0000 (17:08 +0000)]
Fix up poor handling of unsupported-platform case in requirepeer patch.

14 years agoFix thinko in recent patch: 'sock' should be 'conn->sock'.
Tom Lane [Sun, 18 Jul 2010 16:42:20 +0000 (16:42 +0000)]
Fix thinko in recent patch: 'sock' should be 'conn->sock'.

14 years agoAdd SO_PEERCRED check in new unix domain socket permission checking code.
Bruce Momjian [Sun, 18 Jul 2010 15:51:00 +0000 (15:51 +0000)]
Add SO_PEERCRED check in new unix domain socket permission checking code.

14 years agoAdd server authentication over Unix-domain sockets
Peter Eisentraut [Sun, 18 Jul 2010 11:37:26 +0000 (11:37 +0000)]
Add server authentication over Unix-domain sockets

This adds a libpq connection parameter requirepeer that specifies the user
name that the server process is expected to run under.

reviewed by KaiGai Kohei

14 years agoSimplify missing tablespace replay error hint message, but only in HEAD
Bruce Momjian [Sun, 18 Jul 2010 04:47:46 +0000 (04:47 +0000)]
Simplify missing tablespace replay error hint message, but only in HEAD
so we don't need to re-translate for 9.0.

14 years agoAdd a log_file_mode GUC that allows control of the file permissions set on
Tom Lane [Fri, 16 Jul 2010 22:25:51 +0000 (22:25 +0000)]
Add a log_file_mode GUC that allows control of the file permissions set on
log files created by the syslogger process.

In passing, make unix_file_permissions display its value in octal, same
as log_file_mode now does.

Martin Pihlak

14 years agoFix typo spotted by Thom Brown.
Heikki Linnakangas [Fri, 16 Jul 2010 11:35:40 +0000 (11:35 +0000)]
Fix typo spotted by Thom Brown.

14 years agoAdd a paragraph explaining what restartpoints are. Mention that
Heikki Linnakangas [Fri, 16 Jul 2010 11:20:23 +0000 (11:20 +0000)]
Add a paragraph explaining what restartpoints are. Mention that
wal_keep_segments does not take effect during recovery.

Fujii Masao

14 years agoAdd support for dividing money by money (yielding a float8 result) and for
Tom Lane [Fri, 16 Jul 2010 02:15:56 +0000 (02:15 +0000)]
Add support for dividing money by money (yielding a float8 result) and for
casting between money and numeric.

Andy Balholm, reviewed by Kevin Grittner

14 years agoRemove a sanity check in the exclusion-constraint code that prevented users
Tom Lane [Fri, 16 Jul 2010 00:45:30 +0000 (00:45 +0000)]
Remove a sanity check in the exclusion-constraint code that prevented users
from defining non-self-conflicting constraints.

Jeff Davis

Note: I (tgl) objected to removing this check in 9.0 on the grounds that it
was an important sanity check in new, poorly tested code.  However, it should
be all right to remove it for 9.1, since we'll get field testing from the
9.0 branch.

14 years agoRemove duplicate code in DefineOpFamily().
Tom Lane [Fri, 16 Jul 2010 00:13:23 +0000 (00:13 +0000)]
Remove duplicate code in DefineOpFamily().

The code was probably meant to be this way all along, since the subroutine
CreateOpFamily previously had only one caller.  But it wasn't.

KaiGai Kohei

14 years agoUse an <xref> for restore_command reference. Marko Tiikkaja
Tom Lane [Wed, 14 Jul 2010 22:04:21 +0000 (22:04 +0000)]
Use an <xref> for restore_command reference.  Marko Tiikkaja

14 years agoFix several problems in pg_dump's handling of SQL/MED objects, notably failure
Tom Lane [Wed, 14 Jul 2010 21:21:08 +0000 (21:21 +0000)]
Fix several problems in pg_dump's handling of SQL/MED objects, notably failure
to dump a PUBLIC user mapping correctly, as per bug #5560 from Shigeru Hanada.
Use the pg_user_mappings view rather than trying to access pg_user_mapping
directly, so that the code doesn't fail when run by a non-superuser.  And
clean up some minor carelessness such as unsafe usage of fmtId().

Back-patch to 8.4 where this code was added.

14 years agoAllow full SSL certificate verification (wherein libpq checks its host name
Tom Lane [Wed, 14 Jul 2010 17:09:45 +0000 (17:09 +0000)]
Allow full SSL certificate verification (wherein libpq checks its host name
parameter against server cert's CN field) to succeed in the case where
both host and hostaddr are specified.  As with the existing precedents
for Kerberos, GSSAPI, SSPI, it is the calling application's responsibility
that host and hostaddr match up --- we just use the host name as given.
Per bug #5559 from Christopher Head.

In passing, make the error handling and messages for the no-host-name-given
failure more consistent among these four cases, and correct a lie in the
documentation: we don't attempt to reverse-lookup host from hostaddr
if host is missing.

Back-patch to 8.4 where SSL cert verification was introduced.

14 years agoTeach EXPLAIN to print PARAM_EXEC Params as the referenced expressions,
Tom Lane [Tue, 13 Jul 2010 20:57:19 +0000 (20:57 +0000)]
Teach EXPLAIN to print PARAM_EXEC Params as the referenced expressions,
rather than just $N.  This brings the display of nestloop-inner-indexscan
plans back to where it's been, and incidentally improves the display of
SubPlan parameters as well.  In passing, simplify the EXPLAIN code by
having it deal primarily in the PlanState tree rather than separately
searching Plan and PlanState trees.  This is noticeably cleaner for
subplans, and about a wash elsewhere.

One small difference from previous behavior is that EXPLAIN will no longer
qualify local variable references in inner-indexscan plan nodes, since it
no longer sees such nodes as possibly referencing multiple tables.  Vars
referenced through PARAM_EXEC Params are still forcibly qualified, though,
so I don't think the display is any more confusing than before.  Adjust a
couple of examples in the documentation to match this behavior.

14 years agoOn Win32, pg_upgrade cannot sent any server log output to the log file
Bruce Momjian [Tue, 13 Jul 2010 20:03:32 +0000 (20:03 +0000)]
On Win32, pg_upgrade cannot sent any server log output to the log file
because of file access limitations on that platform.

14 years agoRemove incorrect email address for pg_upgrade bug reports.
Bruce Momjian [Tue, 13 Jul 2010 18:14:14 +0000 (18:14 +0000)]
Remove incorrect email address for pg_upgrade bug reports.

14 years agoIn pg_upgrade, report /bin directory checks independent of /data checks.
Bruce Momjian [Tue, 13 Jul 2010 18:09:55 +0000 (18:09 +0000)]
In pg_upgrade, report /bin directory checks independent of /data checks.

14 years agoPrint each test_fsync description while test is running, rather than at
Bruce Momjian [Tue, 13 Jul 2010 17:00:50 +0000 (17:00 +0000)]
Print each test_fsync description while test is running, rather than at
the end.

14 years agoIn pg_upgrade, prevent psql AUTOCOMMIT=off by not loading .psqlrc.
Bruce Momjian [Tue, 13 Jul 2010 15:56:53 +0000 (15:56 +0000)]
In pg_upgrade, prevent psql AUTOCOMMIT=off by not loading .psqlrc.

14 years agoOops, in the previous fix to prevent a cursor that's being used in a FOR
Heikki Linnakangas [Tue, 13 Jul 2010 09:02:30 +0000 (09:02 +0000)]
Oops, in the previous fix to prevent a cursor that's being used in a FOR
loop from being dropped, I missed subtransaction cleanup. Pinned portals
must be dropped at subtransaction cleanup just as they are at main
transaction cleanup.

Per bug #5556 by Robert Walker. Backpatch to 8.0, 7.4 didn't have
subtransactions.

14 years agoRestore pl/pgsql default install release note item.
Bruce Momjian [Mon, 12 Jul 2010 18:30:36 +0000 (18:30 +0000)]
Restore pl/pgsql default install release note item.

14 years ago9.0 release note improvements
Bruce Momjian [Mon, 12 Jul 2010 18:25:21 +0000 (18:25 +0000)]
9.0 release note improvements

Erik Rijkers

14 years agoSpellcheck 9.0 release notes.
Bruce Momjian [Mon, 12 Jul 2010 17:47:39 +0000 (17:47 +0000)]
Spellcheck 9.0 release notes.

14 years agoMake NestLoop plan nodes pass outer-relation variables into their inner
Tom Lane [Mon, 12 Jul 2010 17:01:06 +0000 (17:01 +0000)]
Make NestLoop plan nodes pass outer-relation variables into their inner
relation using the general PARAM_EXEC executor parameter mechanism, rather
than the ad-hoc kluge of passing the outer tuple down through ExecReScan.
The previous method was hard to understand and could never be extended to
handle parameters coming from multiple join levels.  This patch doesn't
change the set of possible plans nor have any significant performance effect,
but it's necessary infrastructure for future generalization of the concept
of an inner indexscan plan.

ExecReScan's second parameter is now unused, so it's removed.

14 years agoDocument bump of minor library version numbers.
Bruce Momjian [Mon, 12 Jul 2010 16:21:51 +0000 (16:21 +0000)]
Document bump of minor library version numbers.

14 years agoBump minor library version numbers, for 9.1 release.
Bruce Momjian [Mon, 12 Jul 2010 16:18:44 +0000 (16:18 +0000)]
Bump minor library version numbers, for 9.1 release.

14 years agoAdd a note about preferred window width to the section about code
Tom Lane [Sat, 10 Jul 2010 18:37:00 +0000 (18:37 +0000)]
Add a note about preferred window width to the section about code
formatting conventions.

14 years agoClarify that "psql -c" ignores psqlrc files.
Robert Haas [Sat, 10 Jul 2010 00:50:24 +0000 (00:50 +0000)]
Clarify that "psql -c" ignores psqlrc files.

Tim Landscheidt

14 years agoAvoid an Assert failure in deconstruct_array() by making get_attstatsslot()
Tom Lane [Fri, 9 Jul 2010 22:57:39 +0000 (22:57 +0000)]
Avoid an Assert failure in deconstruct_array() by making get_attstatsslot()
use the actual element type of the array it's disassembling, rather than
trusting the type OID passed in by its caller.  This is needed because
sometimes the planner passes in a type OID that's only binary-compatible
with the target column's type, rather than being an exact match.  Per an
example from Bernd Helmle.

Possibly we should refactor get_attstatsslot/free_attstatsslot to not expect
the caller to supply type ID data at all, but for now I'll just do the
minimum-change fix.

Back-patch to 7.4.  Bernd's test case only crashes back to 8.0, but since
these subroutines are the same in 7.4, I suspect there may be variant
cases that would crash 7.4 as well.

14 years agoFix ruleutils' get_variable() to print something useful for Vars referencing
Tom Lane [Fri, 9 Jul 2010 21:11:47 +0000 (21:11 +0000)]
Fix ruleutils' get_variable() to print something useful for Vars referencing
resjunk outputs of subquery tlists, instead of throwing an error.  Per bug
#5548 from Daniel Grace.

We might at some point find we ought to back-patch this further than 9.0,
but I think that such Vars can only occur as resjunk members of upper-level
tlists, in which case the problem can't arise because prior versions didn't
print resjunk tlist items in EXPLAIN VERBOSE.

14 years agoProperly report errno/out-of-disk-space error from pg_upgrade when in
Bruce Momjian [Fri, 9 Jul 2010 16:51:23 +0000 (16:51 +0000)]
Properly report errno/out-of-disk-space error from pg_upgrade when in
copy mode, per report from depstein@alliedtesting.com.

Patch suggestion from Magnus.

Backpatch to 9.0.X.

14 years agoAdd a hook in ExecCheckRTPerms().
Robert Haas [Fri, 9 Jul 2010 14:06:01 +0000 (14:06 +0000)]
Add a hook in ExecCheckRTPerms().

This hook allows a loadable module to gain control when table permissions
are checked.  It is expected to be used by an eventual SE-PostgreSQL
implementation, but there are other possible applications as well.  A
sample contrib module can be found in the archives at:

http://archives.postgresql.org/pgsql-hackers/2010-05/msg01095.php

Robert Haas and Stephen Frost

14 years agoStamp HEAD as 9.1devel.
Tom Lane [Fri, 9 Jul 2010 04:10:58 +0000 (04:10 +0000)]
Stamp HEAD as 9.1devel.
(And there was much rejoicing.)

14 years agotag beta3 REL9_0_BETA3
Marc G. Fournier [Fri, 9 Jul 2010 02:43:12 +0000 (02:43 +0000)]
tag beta3

14 years agoUpdate release notes for 9.0 beta 3.
Bruce Momjian [Thu, 8 Jul 2010 22:26:14 +0000 (22:26 +0000)]
Update release notes for 9.0 beta 3.

14 years agoSome small changes for plperl.sgml:
Peter Eisentraut [Thu, 8 Jul 2010 21:35:33 +0000 (21:35 +0000)]
Some small changes for plperl.sgml:
   - wrapped long code-lines, for pdf
   - typo

Erik Rijkers

14 years agoTranslation updates for 9.0beta3
Peter Eisentraut [Thu, 8 Jul 2010 21:32:28 +0000 (21:32 +0000)]
Translation updates for 9.0beta3

14 years agoMinor kibitzing on previous patch: no need to run check more than once.
Tom Lane [Thu, 8 Jul 2010 19:00:11 +0000 (19:00 +0000)]
Minor kibitzing on previous patch: no need to run check more than once.
(_PG_init should be called only once anyway, but as long as it's got an
internal guard against repeat calls, that should be in front of the
version check.)

14 years agoInstall safeguard against running PL/Python 2 and 3 in the same session
Peter Eisentraut [Thu, 8 Jul 2010 18:42:12 +0000 (18:42 +0000)]
Install safeguard against running PL/Python 2 and 3 in the same session

14 years agoDoc change: effected -> affected, per correction from Matthew Wakeling
Bruce Momjian [Thu, 8 Jul 2010 16:44:12 +0000 (16:44 +0000)]
Doc change:  effected -> affected, per correction from Matthew Wakeling

14 years agoAdd a cross-reference to precedence information to CREATE OPERATOR's
Tom Lane [Thu, 8 Jul 2010 16:30:13 +0000 (16:30 +0000)]
Add a cross-reference to precedence information to CREATE OPERATOR's
documentation.  Per suggestion from Marc Cousin.

14 years agoMake the Windows tcp keepalive support depend on the existance of the
Magnus Hagander [Thu, 8 Jul 2010 16:19:50 +0000 (16:19 +0000)]
Make the Windows tcp keepalive support depend on the existance of the
SIO_KEEPALIVE_VALS define instead of just WIN32, since MingW doesn't
support this API (yet?).

14 years agoUpdate obsolete comment. Noted by Josh Tolley.
Tom Lane [Thu, 8 Jul 2010 16:08:30 +0000 (16:08 +0000)]
Update obsolete comment.  Noted by Josh Tolley.

14 years agoFix variant float8 expected files to have exactly the expected spacing.
Tom Lane [Thu, 8 Jul 2010 15:15:05 +0000 (15:15 +0000)]
Fix variant float8 expected files to have exactly the expected spacing.
This wasn't important when we used diff's -w (--ignore-all-space) option
to compare regression result files, but it is now.  Per buildfarm member
canary, which evidently has been offline since we did that in November,
but came to life again today.

14 years agoAdd support for TCP keepalives on Windows, both for backend and the new
Magnus Hagander [Thu, 8 Jul 2010 10:20:14 +0000 (10:20 +0000)]
Add support for TCP keepalives on Windows, both for backend and the new
libpq support.

14 years agoFix "cannot handle unplanned sub-select" error that can occur when a
Tom Lane [Thu, 8 Jul 2010 00:14:04 +0000 (00:14 +0000)]
Fix "cannot handle unplanned sub-select" error that can occur when a
sub-select contains a join alias reference that expands into an expression
containing another sub-select.  Per yesterday's report from Merlin Moncure
and subsequent off-list investigation.

Back-patch to 7.4.  Older versions didn't attempt to flatten sub-selects in
ways that would trigger this problem.

14 years agoAdjust mbutils.c so it won't get broken by future pgindent runs.
Tom Lane [Wed, 7 Jul 2010 15:13:21 +0000 (15:13 +0000)]
Adjust mbutils.c so it won't get broken by future pgindent runs.
To do that, replace L'\0' by (WCHAR) 0.  Perhaps someday we should teach
pgindent about wide-character literals, but so long as this is the only
use-case in the entire Postgres sources, a workaround seems easier.