Tom Lane [Wed, 13 Jul 2005 15:26:06 +0000 (15:26 +0000)]
Fix libpq memory leak during PQreset() --- closePGconn() was not
freeing all transient state of the PGconn object.
Tom Lane [Fri, 8 Jul 2005 18:41:55 +0000 (18:41 +0000)]
Fix config file lexer to not barf if postgresql.conf ends with a comment
that has no terminating newline. Per report from maps.on at gmx.net.
Tom Lane [Fri, 8 Jul 2005 15:24:53 +0000 (15:24 +0000)]
Make libpq_gettext save and restore errno in a Windows-compatible way.
Also, back-patch fix into back branches.
Bruce Momjian [Mon, 4 Jul 2005 14:42:39 +0000 (14:42 +0000)]
Backpatch to 8.0.X openssl portability fixes to pgcrypto.
Bruce Momjian [Mon, 4 Jul 2005 14:12:45 +0000 (14:12 +0000)]
Fix date_trunct for December dates that are in the next year, e.g.:
SELECT date_trunc('week', '2002-12-31'::date);
Backpatch to 8.0.X.
Per report from Nick Johnson.
Tom Lane [Sun, 3 Jul 2005 21:56:27 +0000 (21:56 +0000)]
Fix memory leak in plperl_hash_from_tuple(), per report from Jean-Max Reymond.
Tom Lane [Mon, 27 Jun 2005 02:18:14 +0000 (02:18 +0000)]
Modify pg_dump to assume that a check constraint is inherited if its
name matches the name of any parent-table constraint, without looking
at the constraint text. This is a not-very-bulletproof workaround for
the problem exhibited by Berend Tober last month. We really ought to
record constraint inheritance status in pg_constraint, but it's looking
like that may not get done for 8.1 --- and even if it does, we will
need this kluge for dumping from older servers.
Tom Lane [Sat, 25 Jun 2005 22:47:49 +0000 (22:47 +0000)]
Force a checkpoint before committing a CREATE DATABASE command. This
should fix the recent reports of "index is not a btree" failures,
as well as preventing a more obscure race condition involving changes
to a template database just after copying it with CREATE DATABASE.
Tom Lane [Sat, 25 Jun 2005 16:54:00 +0000 (16:54 +0000)]
Fix ancient memory leak in index_create(): RelationInitIndexAccessInfo
was being called twice in normal operation, leading to a leak of one set
of relcache subsidiary info. Per report from Jeff Gold.
Neil Conway [Wed, 22 Jun 2005 02:02:09 +0000 (02:02 +0000)]
Correct some code in pg_restore when reading the header of a tar archive:
(1) The code doesn't initialize `sum', so the initial "does the checksum
match?" test is wrong.
(2) The loop that is intended to check for a "null block" just checks
the first byte of the tar block 512 times, rather than each of the
512 bytes one time (!), which I'm guessing was the intent.
It was only through sheer luck that this worked in the first place.
Per Coverity static analysis performed by EnterpriseDB.
Neil Conway [Tue, 21 Jun 2005 01:23:25 +0000 (01:23 +0000)]
Fix a potential backend crash during authentication when parsing a
malformed ident map file. This was introduced by the linked list
rewrite in 8.0 -- mea maxima culpa.
Per Coverity static analysis performed by EnterpriseDB.
Tom Lane [Mon, 20 Jun 2005 22:51:49 +0000 (22:51 +0000)]
exec_eval_datum leaks memory when dealing with ROW or REC values.
It never leaked memory before PG 8.0, so none of the callers are
expecting this. Cleanest fix seems to be to make it allocate the needed
memory in estate->eval_econtext, where it will be cleaned up by
the next exec_eval_cleanup. Per report from Bill Rugolsky.
Tom Lane [Mon, 20 Jun 2005 20:44:50 +0000 (20:44 +0000)]
plpgsql's exec_assign_value() freed the old value of a variable before
copying/converting the new value, which meant that it failed badly on
"var := var" if var is of pass-by-reference type. Fix this and a similar
hazard in exec_move_row(); not sure that the latter can manifest before
8.0, but patch it all the way back anyway. Per report from Dave Chapeskie.
Tom Lane [Sat, 18 Jun 2005 20:51:44 +0000 (20:51 +0000)]
When using C-string lookup keys in a dynahash.c hash table, use strncpy()
not memcpy() to copy the offered key into the hash table during HASH_ENTER.
This avoids possible core dump if the passed key is located very near the
end of memory. Per report from Stefan Kaltenbrunner.
Bruce Momjian [Fri, 17 Jun 2005 16:46:45 +0000 (16:46 +0000)]
NetBSD uses "options" not "option".
Peter Eisentraut [Fri, 17 Jun 2005 11:42:02 +0000 (11:42 +0000)]
Translation updates
Tom Lane [Tue, 14 Jun 2005 14:21:23 +0000 (14:21 +0000)]
The random selection in function linear() could deliver a value equal to max
if geqo_rand() returns exactly 1.0, resulting in failure due to indexing
off the end of the pool array. Also, since this is using inexact float math,
it seems wise to guard against roundoff error producing values slightly
outside the expected range. Per report from bug@zedware.org.
Tatsuo Ishii [Sat, 11 Jun 2005 02:46:16 +0000 (02:46 +0000)]
Fix bug in MIC -> EUC_JP conversion. Per Atsushi Ogawa.
Tom Lane [Thu, 9 Jun 2005 19:08:36 +0000 (19:08 +0000)]
Repair error in description of nonblocking usage of PQgetCopyData().
Per Volkan Yazici.
Tom Lane [Tue, 7 Jun 2005 14:05:01 +0000 (14:05 +0000)]
Use just NULL not NULL::TEXT --- the latter coding is unnecessary and
not schema-safe. Per report from Jochem van Dieten.
Tom Lane [Sun, 5 Jun 2005 01:48:45 +0000 (01:48 +0000)]
Code for SET/SHOW TIME ZONE with a fixed-interval timezone was not
prepared for HAVE_INT64_TIMESTAMP. Per report from Guillaume Beaudoin.
Bruce Momjian [Sat, 4 Jun 2005 03:33:25 +0000 (03:33 +0000)]
Update Chinese FAQ to fix XHTML format.
Weiping (Laser)
Bruce Momjian [Fri, 3 Jun 2005 18:17:54 +0000 (18:17 +0000)]
Update Russian FAQ.
Viktor Vislobokov
Tom Lane [Thu, 2 Jun 2005 21:03:46 +0000 (21:03 +0000)]
Push enable/disable of notify and catchup interrupts all the way down
to just around the bare recv() call that gets a command from the client.
The former placement in PostgresMain was unsafe because the intermediate
processing layers (especially SSL) use facilities such as malloc that are
not necessarily re-entrant. Per report from counterstorm.com.
Michael Meskes [Thu, 2 Jun 2005 12:49:26 +0000 (12:49 +0000)]
Added patch by Gavin Scott <gavin@planetacetech.com> for Intel 64bit hardware.
[One half already was committed with the last commit.]
Michael Meskes [Thu, 2 Jun 2005 12:37:25 +0000 (12:37 +0000)]
Fixed memory leak in ecpglib by adding some missing free() commands.
Bruce Momjian [Wed, 1 Jun 2005 23:27:12 +0000 (23:27 +0000)]
Fix log_statement to properly recognize SELECT INTO and CREATE TABLE AS
and DDL statements.
Backpatch fix to 8.0.X.
Per report from Murthy Kambhampaty
Tom Lane [Wed, 1 Jun 2005 17:05:25 +0000 (17:05 +0000)]
patternsel() was improperly stripping RelabelType from the derived
expressions it constructed, causing scalarineqsel to become confused
if the underlying variable was of a domain type. Per report from
Kevin Grittner.
Teodor Sigaev [Wed, 1 Jun 2005 11:45:42 +0000 (11:45 +0000)]
Prevent to divide by zero and range out of 0..1
Tom Lane [Tue, 31 May 2005 19:10:39 +0000 (19:10 +0000)]
Add test to WAL replay to verify that xl_prev points back to the previous
WAL record; this is necessary to be sure we recognize stale WAL records
when a WAL page was only partially written during a system crash.
Tom Lane [Sun, 29 May 2005 17:10:35 +0000 (17:10 +0000)]
expandRTE and get_rte_attribute_type mistakenly always imputed typmod -1
to columns of an RTE that was a function returning RECORD with a column
definition list. Apparently no one has tried to use non-default typmod
with a function returning RECORD before.
Bruce Momjian [Fri, 27 May 2005 22:10:20 +0000 (22:10 +0000)]
Update Farsi FAQ.
Mahmoud Taghizadeh
Neil Conway [Thu, 26 May 2005 02:10:03 +0000 (02:10 +0000)]
Adjust datetime parsing to be more robust. We now pass the length of the
working buffer into ParseDateTime() and reject too-long input there,
rather than checking the length of the input string before calling
ParseDateTime(). The old method was bogus because ParseDateTime() can use
a variable amount of working space, depending on the content of the
input string (e.g. how many fields need to be NUL terminated). This fixes
a minor stack overrun -- I don't _think_ it's exploitable, although I
won't claim to be an expert.
Along the way, fix a bug reported by Mark Dilger: the working buffer
allocated by interval_in() was too short, which resulted in rejecting
some perfectly valid interval input values. I added a regression test for
this fix.
Peter Eisentraut [Wed, 25 May 2005 08:37:22 +0000 (08:37 +0000)]
Translation updates
Tatsuo Ishii [Wed, 25 May 2005 02:17:55 +0000 (02:17 +0000)]
Fix previous patch to exprTypmod.
Tatsuo Ishii [Tue, 24 May 2005 23:02:54 +0000 (23:02 +0000)]
Inserting 5 characters into char(10) does not produce 5 padding spaces
if they are two-byte multibyte characters. Same thing can be happen
if octet_length(multibyte_chars) == n where n is char(n).
Long standing bug since 7.3 days. Per report and fix from Yoshiyuki Asaba.
Tom Lane [Tue, 24 May 2005 18:02:55 +0000 (18:02 +0000)]
Previous fix for "x FULL JOIN y ON true" failed to handle the case
where there was also a WHERE-clause restriction that applied to the
join. The check on restrictlist == NIL is really unnecessary anyway,
because select_mergejoin_clauses already checked for and complained
about any unmergejoinable join clauses. So just take it out.
Neil Conway [Mon, 23 May 2005 02:02:52 +0000 (02:02 +0000)]
Fix typo in PL/Perl Safe.pm initialization that prevented the proper
sharing of %_SHARED. From Andrew Dunstan.
Bruce Momjian [Fri, 20 May 2005 15:53:52 +0000 (15:53 +0000)]
Update Japanese FAQ.
Jun Kuwamura
Neil Conway [Fri, 20 May 2005 12:37:51 +0000 (12:37 +0000)]
Fix typo in ECPG docs, per Andreas Seltenreich.
Tom Lane [Tue, 17 May 2005 17:30:41 +0000 (17:30 +0000)]
Guard against duplicate IDs in input file in SortTocFromFile().
Per report from Brian Hackett.
Bruce Momjian [Tue, 17 May 2005 04:18:30 +0000 (04:18 +0000)]
Convert Chinese FAQ to valid XHTML, finally.
Bruce Momjian [Tue, 17 May 2005 03:41:14 +0000 (03:41 +0000)]
Fix Chinese markup some more.
Bruce Momjian [Mon, 16 May 2005 02:50:58 +0000 (02:50 +0000)]
Update Chinese FAQ to xhtml.
Bruce Momjian [Fri, 13 May 2005 18:13:16 +0000 (18:13 +0000)]
Add -N make flag to bcc builds from /src dir.
Tom Lane [Fri, 13 May 2005 16:48:22 +0000 (16:48 +0000)]
Add missing quote, per Dave Page.
Tom Lane [Fri, 13 May 2005 16:47:03 +0000 (16:47 +0000)]
Fix broken markup.
Tom Lane [Fri, 13 May 2005 16:31:50 +0000 (16:31 +0000)]
Update createuser examples to match the current program behavior,
and add an example showing assignment of a password. Per suggestion
from Jari Aalto (via Martin Pitt).
Bruce Momjian [Fri, 13 May 2005 13:48:05 +0000 (13:48 +0000)]
Update chinese encoding specification.
Neil Conway [Fri, 13 May 2005 06:35:25 +0000 (06:35 +0000)]
Fix bug in COPY CSV mode: handle consecutive embedded newlines in COPY
input. Also add a regression test for this bug. From Andrew Dunstan.
Bruce Momjian [Wed, 11 May 2005 17:58:32 +0000 (17:58 +0000)]
Fix pg_autovacuum -s flag to handle values > 2000 by using sleep()
instead of pg_usleep.
Backpatch to 8.0.X.
Bruce Momjian [Wed, 11 May 2005 16:13:58 +0000 (16:13 +0000)]
Update FAQ URLs.
Robert Treat
Bruce Momjian [Wed, 11 May 2005 16:02:59 +0000 (16:02 +0000)]
Document where to download free Microsoft and Borland development tools.
Bruce Momjian [Wed, 11 May 2005 15:10:56 +0000 (15:10 +0000)]
Document that bcc compiles now need the -N flag, backpatch to 8.0.X.
Bruce Momjian [Wed, 11 May 2005 14:57:26 +0000 (14:57 +0000)]
Update Chinese FAQ, per Magnus.
Bruce Momjian [Wed, 11 May 2005 14:10:40 +0000 (14:10 +0000)]
Backpatch mention that not all functions are listed, with spelling fix.
Bruce Momjian [Wed, 11 May 2005 13:36:53 +0000 (13:36 +0000)]
Add mention that not all functions are listed.
Update Chinese FAQ for HTML.
Bruce Momjian [Wed, 11 May 2005 02:13:21 +0000 (02:13 +0000)]
Backpatch new Chinese FAQ to 8.0.X.
Bruce Momjian [Mon, 9 May 2005 17:26:55 +0000 (17:26 +0000)]
Rename encryption section.
Bruce Momjian [Mon, 9 May 2005 17:24:04 +0000 (17:24 +0000)]
Backpatch FAQ's to 8.0.X for release.
Bruce Momjian [Mon, 9 May 2005 17:14:47 +0000 (17:14 +0000)]
Backpatch encryption doc section to 8.0.X.
Tom Lane [Mon, 9 May 2005 00:10:06 +0000 (00:10 +0000)]
Update release notes for upcoming re-releases.
Tom Lane [Sun, 8 May 2005 23:34:23 +0000 (23:34 +0000)]
Update release checklist to reflect that HISTORY and INSTALL don't
need to be created by hand anymore.
Tom Lane [Sat, 7 May 2005 21:32:53 +0000 (21:32 +0000)]
Repair very-low-probability race condition between relation extension
and VACUUM: in the interval between adding a new page to the relation
and formatting it, it was possible for VACUUM to come along and decide
it should format the page too. Though not harmful in itself, this would
cause data loss if a third transaction were able to insert tuples into
the vacuumed page before the original extender got control back.
Tom Lane [Sat, 7 May 2005 21:22:36 +0000 (21:22 +0000)]
Adjust time qual checking code so that we always check TransactionIdIsInProgress
before we check commit/abort status. Formerly this was done in some paths
but not all, with the result that a transaction might be considered
committed for some purposes before it became committed for others.
Per example found by Jan Wieck.
Tom Lane [Thu, 5 May 2005 20:07:36 +0000 (20:07 +0000)]
Stamp release 8.0.3.
Tom Lane [Thu, 5 May 2005 19:53:37 +0000 (19:53 +0000)]
Make standalone backends ignore pg_database.datallowconn, so that there
is a way to recover from disabling connections to all databases at once.
Bruce Momjian [Thu, 5 May 2005 16:36:20 +0000 (16:36 +0000)]
Add WSACleanup() for Win32 socket cleanup.
Jason Erickson
Tom Lane [Wed, 4 May 2005 22:35:22 +0000 (22:35 +0000)]
Use postmaster_is_alive() check in pg_ctl restart as well as pg_ctl status,
so that restart doesn't fail when old postmaster died unbetimes.
Tom Lane [Wed, 4 May 2005 14:25:30 +0000 (14:25 +0000)]
Spell DELIMITER correctly, per Seamus Dean.
Tom Lane [Tue, 3 May 2005 19:18:16 +0000 (19:18 +0000)]
Alter the signature for encoding conversion functions to declare the
output area as INTERNAL not CSTRING. This is to prevent people from
calling the functions by hand. This is a permanent solution for the
back branches but I hope it is just a stopgap for HEAD.
Tom Lane [Tue, 3 May 2005 16:51:22 +0000 (16:51 +0000)]
Change tsearch2 to not use the unsafe practice of creating functions
that return INTERNAL without also having INTERNAL arguments. Since the
functions in question aren't meant to be called by hand anyway, I just
redeclared them to take 'internal' instead of 'text'. Also add code
to ProcedureCreate() to enforce the restriction, as I should have done
to start with :-(
Dennis Bjorklund [Tue, 3 May 2005 06:28:24 +0000 (06:28 +0000)]
Fix a whitespace problem. From Alvaro Herrera.
Neil Conway [Mon, 2 May 2005 01:56:16 +0000 (01:56 +0000)]
Backport fix for correct quoting in CREATE DOMAIN example. Per Robert
Treat.
Tom Lane [Sat, 30 Apr 2005 20:04:46 +0000 (20:04 +0000)]
Make record_out and record_send extract type information from the passed
record object itself, rather than relying on a second OID argument to be
correct. This patch just changes the function behavior and not the
catalogs, so it's OK to back-patch to 8.0. Will remove the now-redundant
second argument in pg_proc in a separate patch in HEAD only.
Neil Conway [Sat, 30 Apr 2005 08:19:44 +0000 (08:19 +0000)]
GCC 4.0 includes a new warning option, -Wformat-literal, that emits
a warning when a variable is used as a format string for printf()
and similar functions (if the variable is derived from untrusted
data, it could include unexpected formatting sequences). This
emits too many warnings to be enabled by default, but it does
flag a few dubious constructs in the Postgres tree. This patch
fixes up the obvious variants: functions that are passed a variable
format string but no additional arguments.
Most of these are harmless (e.g. the ruleutils stuff), but there
is at least one actual bug here: if you create a trigger named
"%sfoo", pg_dump will read uninitialized memory and fail to dump
the trigger correctly.
Neil Conway [Sat, 30 Apr 2005 08:00:14 +0000 (08:00 +0000)]
This patch fixes a bug in the error message emitted by pg_restore on an
incorrect -F argument: write_msg() expects its first parameter to be a
"module name", not the format string.
Bruce Momjian [Fri, 29 Apr 2005 14:07:34 +0000 (14:07 +0000)]
Improve cleanup from win32 client-only build.
Bruce Momjian [Fri, 29 Apr 2005 13:42:24 +0000 (13:42 +0000)]
Backpatch BCC compile changes to 8.0.X for psql.
Bruce Momjian [Fri, 29 Apr 2005 04:21:39 +0000 (04:21 +0000)]
Fix Borland makefile for libpq and improve it for psql.
Reorder MSC makefile to be more consistent and easier to maintain.
Bruce Momjian [Wed, 27 Apr 2005 20:11:11 +0000 (20:11 +0000)]
Wording improvement.
Bruce Momjian [Wed, 27 Apr 2005 20:09:58 +0000 (20:09 +0000)]
Update PAM documentation, per Alvaro.
Teodor Sigaev [Wed, 27 Apr 2005 13:01:27 +0000 (13:01 +0000)]
workaround for bug in utils/date.h (timetz)
Bruce Momjian [Tue, 26 Apr 2005 03:01:22 +0000 (03:01 +0000)]
Mention that PAM requires the user already exist in the database, per
Dick Davies.
Tom Lane [Mon, 25 Apr 2005 16:58:18 +0000 (16:58 +0000)]
Fix btree_gist to handle timetz zone correctly per recent changes.
Tom Lane [Sat, 23 Apr 2005 22:53:26 +0000 (22:53 +0000)]
Repair two TIME WITH TIME ZONE bugs found by Dennis Vshivkov. Comparison
of timetz values misbehaved in --enable-integer-datetime cases, and
EXTRACT(EPOCH) subtracted the zone instead of adding it in all cases.
Backpatch to all supported releases (except --enable-integer-datetime code
does not exist in 7.2).
Tom Lane [Sat, 23 Apr 2005 05:38:43 +0000 (05:38 +0000)]
int_aggregate's int_enum() doesn't work correctly with arrays that
aren't 1-D, so give an error message instead of failing. Per report
from Ron Mayer.
Bruce Momjian [Fri, 22 Apr 2005 15:53:27 +0000 (15:53 +0000)]
Backpatch of LIMIT / FOR UPDATE behavior, but keep pre-7.3 mention in 8.0.X.
Bruce Momjian [Fri, 22 Apr 2005 04:19:02 +0000 (04:19 +0000)]
Clarify that only crypt can't use md5 pg_shadow passwords.
Bruce Momjian [Thu, 21 Apr 2005 22:19:27 +0000 (22:19 +0000)]
Clarify use of MD5 authentication and pg_shadow encryption.
Tom Lane [Wed, 20 Apr 2005 23:10:22 +0000 (23:10 +0000)]
Make pg_ctl status do a kill() test to verify that the PID found in
postmaster.pid still represents a live postmaster.
Tom Lane [Wed, 20 Apr 2005 21:48:12 +0000 (21:48 +0000)]
Don't try to run clauseless index scans on index types that don't support
it. Per report from Marinos Yannikos.
Tom Lane [Wed, 20 Apr 2005 17:14:58 +0000 (17:14 +0000)]
Fix mis-display of negative fractional seconds in interval values for
--enable-integer-datetimes case. Per report from Oliver Siegmar.
Teodor Sigaev [Tue, 19 Apr 2005 13:58:11 +0000 (13:58 +0000)]
Add comment about permissions on pg_ts* tables
Bruce Momjian [Tue, 19 Apr 2005 01:40:02 +0000 (01:40 +0000)]
Update PITR wording, per Simon.
Tom Lane [Mon, 18 Apr 2005 23:48:01 +0000 (23:48 +0000)]
pg_dumpall should enforce the server version check for itself, rather
than simply passing it down to pg_dump. Else, version-related failures
in pg_dumpall itself generate unhelpful error messages.
Tom Lane [Mon, 18 Apr 2005 17:11:15 +0000 (17:11 +0000)]
record_in and record_recv must be careful to return a separately
pfree'able result, since some callers expect to be able to pfree
the result of a pass-by-reference function. Per report from Chris Trawick.
Bruce Momjian [Mon, 18 Apr 2005 01:29:08 +0000 (01:29 +0000)]
Update PITR mention of which WAL files are needed.
Bruce Momjian [Sun, 17 Apr 2005 03:05:27 +0000 (03:05 +0000)]
Clarify name of file to be checked for PITR expiring.
Bruce Momjian [Fri, 15 Apr 2005 22:49:45 +0000 (22:49 +0000)]
Fix comment typo.