users/gsingh/postgres.git
18 years agotransformColumnDefinition failed to complain about
Tom Lane [Wed, 20 Jun 2007 18:21:25 +0000 (18:21 +0000)]
transformColumnDefinition failed to complain about
create table foo (bar int default null default 3);
due to not thinking about the special-case handling of DEFAULT NULL.
Problem noticed while investigating bug #3396.

18 years agoCREATE DOMAIN ... DEFAULT NULL failed because gram.y special-cases DEFAULT
Tom Lane [Wed, 20 Jun 2007 18:16:10 +0000 (18:16 +0000)]
CREATE DOMAIN ... DEFAULT NULL failed because gram.y special-cases DEFAULT
NULL and DefineDomain didn't.  Bug goes all the way back to original coding
of domains.  Per bug #3396 from Sergey Burladyan.

18 years agoImplement a chunking protocol for writes to the syslogger pipe, with messages
Andrew Dunstan [Thu, 14 Jun 2007 01:50:35 +0000 (01:50 +0000)]
Implement a chunking protocol for writes to the syslogger pipe, with messages
reassembled in the syslogger before writing to the log file. This prevents
partial messages from being written, which mucks up log rotation, and
messages from different backends being interleaved, which causes garbled
logs. Backport as far as 8.0, where the syslogger was introduced.

Tom Lane and Andrew Dunstan

18 years agoAllow numeric_fac() to be interrupted, since it can take quite a while for
Tom Lane [Sat, 9 Jun 2007 15:52:54 +0000 (15:52 +0000)]
Allow numeric_fac() to be interrupted, since it can take quite a while for
large inputs.  Also cause it to error out immediately if the result will
overflow, instead of grinding through a lot of calculation first.
Per gripe from Jim Nasby.

18 years agoFix array_dims() example to be consistent with the data previously shown.
Tom Lane [Thu, 7 Jun 2007 14:50:18 +0000 (14:50 +0000)]
Fix array_dims() example to be consistent with the data previously shown.
Christian Rossow

18 years agoOn win32, don't use SO_REUSEADDR for TCP sockets.
Magnus Hagander [Mon, 4 Jun 2007 11:59:27 +0000 (11:59 +0000)]
On win32, don't use SO_REUSEADDR for TCP sockets.

Per failure on buildfarm member baiji and subsequent discussion.

18 years agoFix erroneous error reporting for overlength input in text_date(),
Tom Lane [Sat, 2 Jun 2007 16:41:31 +0000 (16:41 +0000)]
Fix erroneous error reporting for overlength input in text_date(),
text_time(), and text_timetz().  7.4-vintage bug found by Greg Stark.

18 years agoFix aboriginal bug in BufFileDumpBuffer that would cause it to write the
Tom Lane [Fri, 1 Jun 2007 23:43:28 +0000 (23:43 +0000)]
Fix aboriginal bug in BufFileDumpBuffer that would cause it to write the
wrong data when dumping a bufferload that crosses a component-file boundary.
This probably has not been seen in the wild because (a) component files are
normally 1GB apiece and (b) non-block-aligned buffer usage is relatively
rare.  But it's fairly easy to reproduce a problem if one reduces RELSEG_SIZE
in a test build.  Kudos to Kurt Harriman for spotting the bug.

18 years agoFix overly-strict sanity check in BeginInternalSubTransaction that made it
Tom Lane [Wed, 30 May 2007 21:02:02 +0000 (21:02 +0000)]
Fix overly-strict sanity check in BeginInternalSubTransaction that made it
fail when used in a deferred trigger.  Bug goes back to 8.0; no doubt the
reason it hadn't been noticed is that we've been discouraging use of
user-defined constraint triggers.  Per report from Frank van Vugt.

18 years agoFix spurious German index entry
Peter Eisentraut [Mon, 21 May 2007 15:06:44 +0000 (15:06 +0000)]
Fix spurious German index entry

18 years agoRemove redundant logging of send failures when SSL is in use. While pqcomm.c
Tom Lane [Fri, 18 May 2007 01:20:40 +0000 (01:20 +0000)]
Remove redundant logging of send failures when SSL is in use.  While pqcomm.c
had been taught not to do that ages ago, the SSL code was helpfully bleating
anyway.  Resolves some recent reports such as bug #3266; however the
underlying cause of the related bug #2829 is still unclear.

18 years agoDocument that CLUSTER breaks MVCC visibility rules.
Magnus Hagander [Sun, 13 May 2007 16:04:28 +0000 (16:04 +0000)]
Document that CLUSTER breaks MVCC visibility rules.
(Not needed in cvs head, because CLUSTER itself is fixed there)

Heikki Linnakangas

18 years agoFix a thinko in my patch of a couple months ago for bug #3116: it did the
Tom Lane [Tue, 1 May 2007 18:54:17 +0000 (18:54 +0000)]
Fix a thinko in my patch of a couple months ago for bug #3116: it did the
wrong thing when inlining polymorphic SQL functions, because it was using the
function's declared return type where it should have used the actual result
type of the current call.  In 8.1 and 8.2 this causes obvious failures even if
you don't have assertions turned on; in 8.0 and 7.4 it would only be a problem
if the inlined expression were used as an input to a function that did
run-time type determination on its inputs.  Add a regression test, since this
is evidently an under-tested area.

18 years agoFix dynahash.c to suppress hash bucket splits while a hash_seq_search() scan
Tom Lane [Thu, 26 Apr 2007 23:25:30 +0000 (23:25 +0000)]
Fix dynahash.c to suppress hash bucket splits while a hash_seq_search() scan
is in progress on the same hashtable.  This seems the least invasive way to
fix the recently-recognized problem that a split could cause the scan to
visit entries twice or (with much lower probability) miss them entirely.
The only field-reported problem caused by this is the "failed to re-find
shared lock object" PANIC in COMMIT PREPARED reported by Michel Dorochevsky,
which was caused by multiply visited entries.  However, it seems certain
that mdsync() is vulnerable to missing required fsync's due to missed
entries, and I am fearful that RelationCacheInitializePhase2() might be at
risk as well.  Because of that and the generalized hazard presented by this
bug, back-patch all the supported branches.

Along the way, fix pg_prepared_statement() and pg_cursor() to not assume
that the hashtables they are examining will stay static between calls.
This is risky regardless of the newly noted dynahash problem, because
hash_seq_search() has never promised to cope with deletion of table entries
other than the just-returned one.  There may be no bug here because the only
supported way to call these functions is via ExecMakeTableFunctionResult()
which will cycle them to completion before doing anything very interesting,
but it seems best to get rid of the assumption.  This affects 8.2 and HEAD
only, since those functions weren't there earlier.

18 years agoFix newly-introduced documentation typo.
Neil Conway [Mon, 23 Apr 2007 16:53:09 +0000 (16:53 +0000)]
Fix newly-introduced documentation typo.

18 years agoUpdate configure for release REL8_0_13
PostgreSQL Daemon [Fri, 20 Apr 2007 03:44:17 +0000 (03:44 +0000)]
Update configure for release

Security: hold for release

18 years agoFix markup.
Tom Lane [Fri, 20 Apr 2007 03:27:54 +0000 (03:27 +0000)]
Fix markup.

Security: CVE-2007-2138

18 years agoSupport explicit placement of the temporary-table schema within search_path.
Tom Lane [Fri, 20 Apr 2007 02:38:33 +0000 (02:38 +0000)]
Support explicit placement of the temporary-table schema within search_path.
This is needed to allow a security-definer function to set a truly secure
value of search_path.  Without it, a malicious user can use temporary objects
to execute code with the privileges of the security-definer function.  Even
pushing the temp schema to the back of the search path is not quite good
enough, because a function or operator at the back of the path might still
capture control from one nearer the front due to having a more exact datatype
match.  Hence, disable searching the temp schema altogether for functions and
operators.

Security: CVE-2007-2138

18 years agoSync timezone data with 2007e zic release.
Tom Lane [Thu, 19 Apr 2007 22:44:51 +0000 (22:44 +0000)]
Sync timezone data with 2007e zic release.

18 years agoRepair PANIC condition in hash indexes when a previous index extension attempt
Tom Lane [Thu, 19 Apr 2007 20:24:28 +0000 (20:24 +0000)]
Repair PANIC condition in hash indexes when a previous index extension attempt
failed (due to lock conflicts or out-of-space).  We might have already
extended the index's filesystem EOF before failing, causing the EOF to be
beyond what the metapage says is the last used page.  Hence the invariant
maintained by the code needs to be "EOF is at or beyond last used page",
not "EOF is exactly the last used page".  Problem was created by my patch
of 2006-11-19 that attempted to repair bug #2737.  Since that was
back-patched to 7.4, this needs to be as well.  Per report and test case
from Vlastimil Krejcir.

18 years agoRelease wording updates for releases 8.2.4, 8.1.9, 8.0.13, 7.4.17, 7.3.19.
Bruce Momjian [Thu, 19 Apr 2007 13:02:15 +0000 (13:02 +0000)]
Release wording updates for releases 8.2.4, 8.1.9, 8.0.13, 7.4.17, 7.3.19.

18 years agoUpdate FAQ to mention most recent release for releases
Bruce Momjian [Thu, 19 Apr 2007 04:04:41 +0000 (04:04 +0000)]
Update FAQ to mention most recent release for releases
8.2.4, 8.1.9, 8.0.13, 7.4.17, 7.3.19.

18 years agoStamp releases 8.2.4, 8.1.9, 8.0.13, 7.4.17, 7.3.19.
Bruce Momjian [Thu, 19 Apr 2007 03:06:46 +0000 (03:06 +0000)]
Stamp releases 8.2.4, 8.1.9, 8.0.13, 7.4.17, 7.3.19.

18 years agoRelease note updates for 8.2.4, 8.1.9, 8.0.13, 7.4.17, 7.3.19.
Bruce Momjian [Thu, 19 Apr 2007 02:47:01 +0000 (02:47 +0000)]
Release note updates for 8.2.4, 8.1.9, 8.0.13, 7.4.17, 7.3.19.

18 years agoTranslation updates
Peter Eisentraut [Wed, 18 Apr 2007 20:57:58 +0000 (20:57 +0000)]
Translation updates

18 years agoDon't write timing output in quiet mode.
Magnus Hagander [Mon, 16 Apr 2007 20:15:53 +0000 (20:15 +0000)]
Don't write timing output in quiet mode.

Merlin Moncure

18 years agoFix check_sql_fn_retval to allow the case where a SQL function declared to
Tom Lane [Mon, 2 Apr 2007 18:49:49 +0000 (18:49 +0000)]
Fix check_sql_fn_retval to allow the case where a SQL function declared to
return void ends with a SELECT, if that SELECT has a single result that is
also of type void.  Without this, it's hard to write a void function that
calls another void function.  Per gripe from Peter.

Back-patch as far as 8.0.

18 years agoFix caching of unsuccessful initialization of parser or configuration.
Teodor Sigaev [Mon, 2 Apr 2007 11:43:11 +0000 (11:43 +0000)]
Fix caching of unsuccessful initialization of parser or configuration.
Per report from Listmail <[email protected]>

18 years agoFix pg_wchar_table's maxmblen field of EUC_CN, EUC_TW, MULE_INTERNAL
Tatsuo Ishii [Mon, 26 Mar 2007 11:46:25 +0000 (11:46 +0000)]
Fix pg_wchar_table's maxmblen field of EUC_CN, EUC_TW, MULE_INTERNAL
and GB18030. patches from ITAGAKI Takahiro.

18 years agoSPI_cursor_open failed to enforce that only read-only queries could be
Tom Lane [Sat, 17 Mar 2007 03:16:03 +0000 (03:16 +0000)]
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.

18 years agoFix a longstanding bug in VACUUM FULL's handling of update chains. The code
Tom Lane [Wed, 14 Mar 2007 18:49:18 +0000 (18:49 +0000)]
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.

18 years agoArrange to install a "posixrules" entry in our timezone database, so that
Tom Lane [Wed, 14 Mar 2007 17:38:29 +0000 (17:38 +0000)]
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.

18 years agoFix oversight in original coding of inline_function(): since
Tom Lane [Tue, 6 Mar 2007 22:45:35 +0000 (22:45 +0000)]
Fix oversight in original coding of inline_function(): since
check_sql_fn_retval allows binary-compatibility cases, the expression
extracted from an inline-able SQL function might have a type that is only
binary-compatible with the declared function result type.  To avoid possibly
changing the semantics of the expression, we should insert a RelabelType node
in such cases.  This has only been shown to have bad consequences in recent
8.1 and up releases, but I suspect there may be failure cases in the older
branches too, so patch it all the way back.  Per bug #3116 from Greg Mullane.

Along the way, fix an omission in eval_const_expressions_mutator: it failed
to copy the relabelformat field when processing a RelabelType.  No known
observable failures from this, but it definitely isn't intended behavior.

18 years agoFix markQueryForLocking() to work correctly in the presence of nested views.
Tom Lane [Thu, 1 Mar 2007 18:50:49 +0000 (18:50 +0000)]
Fix markQueryForLocking() to work correctly in the presence of nested views.
It has been wrong for this case since it was first written for 7.1 :-(
Per report from Pavel HanĂ¡k.

18 years agoBackported bug fix for #2956.
Michael Meskes [Tue, 27 Feb 2007 13:26:59 +0000 (13:26 +0000)]
Backported bug fix for #2956.

18 years agoFix portal management code to support non-default command completion tags for
Tom Lane [Sun, 18 Feb 2007 19:49:42 +0000 (19:49 +0000)]