aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
...
* Create a script to handle stamping release version numbers into files,Tom Lane2008-06-10
| | | | replacing the tedious and error-prone manual process we've been using.
* Fix datetime input functions to correctly detect integer overflow whenTom Lane2008-06-09
| | | | | running on a 64-bit platform ... strtol() will happily return 64-bit output in that case. Per bug #4231 from Geoff Tolley.
* Stamp 8.2.9 (except for configure.in/configure)Tom Lane2008-06-08
|
* ALTER AGGREGATE OWNER seems to have been missed by the last couple ofTom Lane2008-06-08
| | | | | | | patches that dealt with object ownership. It wasn't updating pg_shdepend nor adjusting the aggregate's ACL. In 8.2 and up, fix this permanently by making it use AlterFunctionOwner_oid. In 8.1, the function code wasn't factored that way, so just copy and paste.
* Fix pg_get_ruledef() so that negative numeric constants are parenthesized.Tom Lane2008-06-06
| | | | | | | | | | This is needed because :: casting binds more tightly than minus, so for example -1::integer is not the same as (-1)::integer, and there are cases where the difference is important. In particular this caused a failure in SELECT DISTINCT ... ORDER BY ... where expressions that should have matched were seen as different by the parser; but I suspect that there could be other cases where failure to parenthesize leads to subtler semantic differences in reloaded rules. Per report from Alexandr Popov.
* Stamp 8.2.8 (except for configure.in/configure)Tom Lane2008-06-05
|
* Translation updates.Tom Lane2008-06-05
|
* Added SQL to list of allowed variable names.Michael Meskes2008-06-04
|
* Update time zone data files to tzdata release 2008c (DST law changes inTom Lane2008-06-01
| | | | Morocco, Iraq, Choibalsan, Pakistan, Syria, Cuba, Argentina/San_Luis).
* Backpatch Zdenek Kotala's fix to prevent pglz_decompress from stomping onTom Lane2008-05-28
| | | | | | | | memory if the compressed data is corrupt. Backpatch as far as 8.2. The issue exists in older branches too, but given the lack of field reports, it's not clear it's worth any additional effort to adapt the patch to the slightly different code in older branches.
* Back-patch the 8.3 fix that prohibits TRUNCATE, CLUSTER, and REINDEX when theTom Lane2008-05-27
| | | | | | | current transaction has any open references to the target relation or index (implying it has an active query using the relation). Also back-patch the 8.2 fix that prohibits TRUNCATE and CLUSTER when there are pending AFTER-trigger events. Per suggestion from Heikki.
* Explicitly bind gettext() to the UTF8 locale when in use.Magnus Hagander2008-05-27
| | | | | | | | | | This is required on Windows due to the special locale handling for UTF8 that doesn't change the full environment. Fixes crash with translated error messages per bugs 4180 and 4196. Tom Lane
* Fix an old corner-case bug in set_config_option: push_old_value has to beTom Lane2008-05-26
| | | | | | | | | | | | | | called before, not after, calling the assign_hook if any. This is because push_old_value might fail (due to palloc out-of-memory), and in that case there would be no stack entry to tell transaction abort to undo the GUC assignment. Of course the actual assignment to the GUC variable hasn't happened yet --- but the assign_hook might have altered subsidiary state. Without a stack entry we won't call it again to make it undo such actions. So this is necessary to make the world safe for assign_hooks with side effects. Per a discussion a couple weeks ago with Magnus. Back-patch to 8.0. 7.x did not have the problem because it did not have allocatable stacks of GUC values.
* Adjust timestamp regression tests to prevent two low-probability failureTom Lane2008-05-25
| | | | | | | | | | | | | | | | | | cases. Recent buildfarm experience shows that it is sometimes possible to execute several SQL commands in less time than the granularity of Windows' not-very-high-resolution gettimeofday(), leading to a failure because the tests expect the value of now() to change and it doesn't. Also, it was recognized some time ago that the same area of the tests could fail if local midnight passes between the insertion and the checking of the values for 'yesterday', 'tomorrow', etc. Clean all this up per ideas from myself and Greg Stark. There remains a window for failure if the transaction block is entered exactly at local midnight (so that 'now' and 'today' have the same value), but that seems low-probability enough to live with. Since the point of this change is mostly to eliminate buildfarm noise, back-patch to all versions we are still actively testing.
* Remove arbitrary 10MB limit on two-phase state file size. It's not that hardHeikki Linnakangas2008-05-19
| | | | | | | | | | | | | | | | to go beoynd 10MB, as demonstrated by Gavin Sharry's example of dropping a schema with ~25000 objects. The really bogus thing about the limit was that it was enforced when a state file file was read in, not when it was written, so you would end up with a prepared transaction that you can't commit or abort, and the only recourse was to shut down the server and remove the file by hand. Raise the limit to MaxAllocSize, and enforce it also when a state file is written. We could've removed the limit altogether, but reading in a file larger than MaxAllocSize would fail anyway because we read it into a palloc'd buffer. Backpatch down to 8.1, where 2PC and this issue was introduced.
* Don't try to close negative file descriptors, since this can causeMagnus Hagander2008-05-13
| | | | | | | crashes on certain platforms. In particular, the MSVC runtime is known to do this. Fixes bug #4162, reported and diagnosed by Javier Pimas
* Fix an ancient oversight in change_varattnos_of_a_node: it neglected to updateTom Lane2008-05-09
| | | | | | | | | | | | | | | | varoattno along with varattno. This resulted in having Vars that were not seen as equal(), causing inheritance of the "same" constraint from different parent relations to fail. An example is create table pp1 (f1 int check (f1>0)); create table cc1 (f2 text, f3 int) inherits (pp1); create table cc2(f4 float) inherits(pp1,cc1); Backpatch as far as 7.4. (The test case still fails in 7.4, for reasons that I don't feel like investigating at the moment.) This is a backpatch commit only. The fix will be applied in HEAD as part of the upcoming pg_constraint patch.
* Add more dependencies from libpgport required byMagnus Hagander2008-05-05
| | | | | | standalone msvc build of libpq. Hiroshi Saito
* The 8.2 patch that added support for an alias on the target table ofTom Lane2008-05-03
| | | | | UPDATE/DELETE forgot to teach ruleutils.c to display the alias. Per bug #4141 from Mathias Seiler.
* Fix ALTER TABLE ADD COLUMN ... PRIMARY KEY so that the new column is correctlyTom Lane2008-04-24
| | | | | | | | | | checked to see if it's been initialized to all non-nulls. The implicit NOT NULL constraint was not being checked during the ALTER (in fact, not even if there was an explicit NOT NULL too), because ATExecAddColumn neglected to set the flag needed to make the test happen. This has been broken since the capability was first added, in 8.0. Brendan Jurd, per a report from Kaloyan Iliev.
* Fix using too many LWLocks bug, reported by Craig RingerTeodor Sigaev2008-04-22
| | | | | | | <craig@postnewspapers.com.au>. It was my mistake, I missed limitation of number of held locks, now GIN doesn't use continiuous locks, but still hold buffers pinned to prevent interference with vacuum's deletion algorithm.
* Repair two places where SIGTERM exit could leave shared memory stateTom Lane2008-04-17
| | | | | | | | | | | | | | corrupted. (Neither is very important if SIGTERM is used to shut down the whole database cluster together, but there's a problem if someone tries to SIGTERM individual backends.) To do this, introduce new infrastructure macros PG_ENSURE_ERROR_CLEANUP/PG_END_ENSURE_ERROR_CLEANUP that take care of transiently pushing an on_shmem_exit cleanup hook. Also use this method for createdb cleanup --- that wasn't a shared-memory-corruption problem, but SIGTERM abort of createdb could leave orphaned files lying around. Backpatch as far as 8.2. The shmem corruption cases don't exist in 8.1, and the createdb usage doesn't seem important enough to risk backpatching further.
* Fix LOAD_CRIT_INDEX() macro to take out AccessShareLock on the system indexTom Lane2008-04-16
| | | | | | | | | | it is trying to build a relcache entry for. This is an oversight in my 8.2 patch that tried to ensure we always took a lock on a relation before trying to build its relcache entry. The implication is that if someone committed a reindex of a critical system index at about the same time that some other backend were starting up without a valid pg_internal.init file, the second one might PANIC due to not seeing any valid version of the index's pg_class row. Improbable case, but definitely not impossible.
* Avoid using unnecessary pgwin32_safestat in libpq.Andrew Dunstan2008-04-16
|
* Add multi-line flag to regex that needs it. Backpatch to 8.2. Fix from ↵Andrew Dunstan2008-04-15
| | | | Andreas Zeugswetter
* A quick try at un-breaking the Cygwin build. Whether it needs theTom Lane2008-04-12
| | | | | pgwin32_safestat remains to be determined, but in any case the current code is not tolerable.
* Fix several datatype input functions that were allowing unused bytes in theirTom Lane2008-04-11
| | | | | | | | | | | | | results to contain uninitialized, unpredictable values. While this was okay as far as the datatypes themselves were concerned, it's a problem for the parser because occurrences of the "same" literal might not be recognized as equal by datumIsEqual (and hence not by equal()). It seems sufficient to fix this in the input functions since the only critical use of equal() is in the parser's comparisons of ORDER BY and DISTINCT expressions. Per a trouble report from Marc Cousin. Patch all the way back. Interestingly, array_in did not have the bug before 8.2, which may explain why the issue went unnoticed for so long.
* Create wrapper pgwin32_safestat() and redefine stat() to itMagnus Hagander2008-04-10
| | | | | | | on win32, because the stat() function in the runtime cannot be trusted to always update the st_size field. Per report and research by Sergey Zubkovsky.
* Fixed bug in PGTYPEStimestamp_sub that used pointers instead of the values ↵Michael Meskes2008-04-10
| | | | to substract.
* Defend against JOINs having more than 32K columns altogether. We cannotTom Lane2008-04-05
| | | | | | | | | | | | currently support this because we must be able to build Vars referencing join columns, and varattno is only 16 bits wide. Perhaps this should be improved in future, but considering that it never came up before, I'm not sure the problem is worth much effort. Per bug #4070 from Marcello Ceschia. The problem seems largely academic in 8.0 and 7.4, because they have (different) O(N^2) performance issues with such wide joins, but back-patch all the way anyway.
* Fix a number of places that were making file-type tests infelicitously.Tom Lane2008-03-31
| | | | | | | | | | | | | | | | | The places that did, eg, (statbuf.st_mode & S_IFMT) == S_IFDIR were correct, but there is no good reason not to use S_ISDIR() instead, especially when that's what the other 90% of our code does. The places that did, eg, (statbuf.st_mode & S_IFDIR) were flat out *wrong* and would fail in various platform-specific ways, eg a symlink could be mistaken for a regular file on most Unixen. The actual impact of this is probably small, since the problem cases seem to always involve symlinks or sockets, which are unlikely to be found in the directories that PG code might be scanning. But it's clearly trouble waiting to happen, so patch all the way back anyway. (There seem to be no occurrences of the mistake in 7.4.)
* Adjust DatumGetBool macro so that it isn't fooled by garbage in the DatumTom Lane2008-03-25
| | | | | | | | | | | | | | to the left of the actual bool value. While in most cases there won't be any, our support for old-style user-defined functions violates the C spec to the extent of calling functions that might return char or short through a function pointer declared to return "char *", which we then coerce to Datum. It is not surprising that the result might contain garbage high-order bits ... what is surprising is that we didn't see such cases long ago. Per report from Magnus. This is a back-patch of a change that was made in HEAD almost exactly a year ago. I had refrained from back-patching at the time, but now we find that this is *necessary* for contrib to work with gcc 4.3.
* Add the missing cyrillic "Yo" characters ('e' and 'E' with two dots) to theHeikki Linnakangas2008-03-20
| | | | | | | | | | | | | | | ISO_8859-5 <-> MULE_INTERNAL conversion tables. This was discovered when trying to convert a string containing those characters from ISO_8859-5 to Windows-1251, because we use MULE_INTERNAL/KOI8R as an intermediate encoding between those two. While the missing "Yo" was just an omission in the conversion tables, there are a few other characters like the "Numero" sign ("No" as a single character) that exists in all the other cyrillic encodings (win1251, ISO_8859-5 and cp866), but not in KOI8R. Added comments about that. Patch by Sergey Burladyan. Back-patch to 7.4.
* Fix regexp substring matching (substring(string from pattern)) for the cornerTom Lane2008-03-19
| | | | | | | | | | | | case where there is a match to the pattern overall but the user has specified a parenthesized subexpression and that subexpression hasn't got a match. An example is substring('foo' from 'foo(bar)?'). This should return NULL, since (bar) isn't matched, but it was mistakenly returning the whole-pattern match instead (ie, 'foo'). Per bug #4044 from Rui Martins. This has been broken since the beginning; patch in all supported versions. The old behavior was sufficiently inconsistent that it's impossible to believe anyone is depending on it.
* Translation updatesREL8_2_7Peter Eisentraut2008-03-14
|
* Stamp version 8.2.7, except for configure.in/configure.Tom Lane2008-03-13
|
* Update to tzdata 2008a distribution (Chilean DST law change).Tom Lane2008-03-13
|
* Fix varstr_cmp's special case for UTF8 encoding on Windows so that stringsTom Lane2008-03-13
| | | | | | | | | | | | that are reported as "equal" by wcscoll() are checked to see if they really are bitwise equal, and are sorted per strcmp() if not. We made this happen a couple of years ago in the regular code path, but it unaccountably got left out of the Windows/UTF8 case (probably brain fade on my part at the time). As in the prior set of changes, affected users may need to reindex indexes on textual columns. Backpatch as far as 8.2, which is the oldest release we are still supporting on Windows.
* Fix LISTEN/NOTIFY race condition reported by Laurent Birtz, by postponingTom Lane2008-03-12
| | | | | | | | | | | | | | | | | | pg_listener modifications commanded by LISTEN and UNLISTEN until the end of the current transaction. This allows us to hold the ExclusiveLock on pg_listener until after commit, with no greater risk of deadlock than there was before. Aside from fixing the race condition, this gets rid of a truly ugly kludge that was there before, namely having to ignore HeapTupleBeingUpdated failures during NOTIFY. There is a small potential incompatibility, which is that if a transaction issues LISTEN or UNLISTEN and then looks into pg_listener before committing, it won't see any resulting row insertion or deletion, where before it would have. It seems unlikely that anyone would be depending on that, though. This patch also disallows LISTEN and UNLISTEN inside a prepared transaction. That case had some pretty undesirable properties already, such as possibly allowing pg_listener entries to be made for PIDs no longer present, so disallowing it seems like a better idea than trying to maintain the behavior.
* Change hashscan.c to keep its list of active hash index scans inTom Lane2008-03-07
| | | | | | | | | | | | | TopMemoryContext, rather than scattered through executor per-query contexts. This poses no danger of memory leak since the ResourceOwner mechanism guarantees release of no-longer-needed items. It is needed because the per-query context might already be released by the time we try to clean up the hash scan list. Report by ykhuang, diagnosis by Heikki. Back-patch to 8.0, where the ResourceOwner-based cleanup was introduced. The given test case does not fail before 8.2, probably because we rearranged transaction abort processing somehow; but this coding is undoubtedly risky so I'll patch 8.0 and 8.1 anyway.
* Add support for dlopen on recent NetBSD/MIPS, per Rémi Zara.Alvaro Herrera2008-03-05
|
* In PrepareToInvalidateCacheTuple, don't force initialization of catalogTom Lane2008-03-05
| | | | | | | | | | caches that we don't actually need to touch. This saves some trivial number of cycles and avoids certain cases of deadlock when doing concurrent VACUUM FULL on system catalogs. Per report from Gavin Roy. Backpatch to 8.2. In earlier versions, CatalogCacheInitializeCache didn't lock the relation so there's no deadlock risk (though that certainly had plenty of risks of its own).
* Fix PREPARE TRANSACTION to reject the case where the transaction has dropped aTom Lane2008-03-04
| | | | | | | temporary table; we can't support that because there's no way to clean up the source backend's internal state if the eventual COMMIT PREPARED is done by another backend. This was checked correctly in 8.1 but I broke it in 8.2 :-(. Patch by Heikki Linnakangas, original trouble report by John Smith.
* Venezuela Time now means UTC-4:30, not UTC-4:00. Adjust our treatmentTom Lane2008-03-02
| | | | of "VET" accordingly. Per bug #3997 from Aaron Mizrachi.
* Don't call AddUserToDacl on CygwinAndrew Dunstan2008-02-29
|
* Fix handling of restricted processes for Windows Vista (mainly),Magnus Hagander2008-02-29
| | | | | | | | | by explicitly adding back the user to the DACL of the new process. This fixes the failure case when executing as the Administrator user, which had no permissions left at all after we dropped the Administrators group. Dave Page with some modifications from me
* Fix several memory leaks when rescanning SRFs. Arrange for an SRF'sNeil Conway2008-02-29
| | | | | | | | | | | | | | | | | | "multi_call_ctx" to be a distinct sub-context of the EState's per-query context, and delete the multi_call_ctx as soon as the SRF finishes execution. This avoids leaking SRF memory until the end of the current query, which is particularly egregious when the SRF is scanned multiple times. This change also fixes a leak of the fields of the AttInMetadata struct in shutdown_MultiFuncCall(). Also fix a leak of the SRF result TupleDesc when rescanning a FunctionScan node. The TupleDesc is allocated in the per-query context for every call to ExecMakeTableFunctionResult(), so we should free it after calling that function. Since the SRF might choose to return a non-expendable TupleDesc, we only free the TupleDesc if it is not being reference-counted. Backpatch to 8.3 and 8.2 stable branches.
* If RelationBuildDesc() fails to open a critical system index, PANIC withTom Lane2008-02-27
| | | | | a relevant error message instead of just dumping core. Odd that nobody reported this before Darren Reed.
* Fix uninstall target.Peter Eisentraut2008-02-26
|
* Fix datetime input to behave correctly for Feb 29 in years BC.Tom Lane2008-02-25
| | | | | | | | | | | | | | | | | | | Formerly, DecodeDate attempted to verify the day-of-the-month exactly, but it was under the misapprehension that it would know whether we were looking at a BC year or not. In reality this check can't be made until the calling function (eg DecodeDateTime) has processed all the fields. So, split the BC adjustment and validity checks out into a new function ValidateDate that is called only after processing all the fields. In passing, this patch makes DecodeTimeOnly work for BC inputs, which it never did before. (The historical veracity of all this is nonexistent, of course, but if we're going to say we support proleptic Gregorian calendar then we should do it correctly. In any case the unpatched code is broken because it could emit dates that it would then reject on re-inputting.) Per report from Bernd Helmle. Back-patch as far as 8.0; in 7.x we were not using our own calendar support and so this seems a bit too risky to put into 7.4.