aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
...
* Run updated copyright.pl on HEAD and 9.2 trees, updating the psqlBruce Momjian2012-07-06
| | | | | | \copyright output to 2012. Backpatch to 9.2.
* Have copyright.pl skip updating something that is just the current year,Bruce Momjian2012-07-06
| | | | | | to avoid producing dups, e.g. 2012-2012 Backpatch to 9.2.
* Modify copyright.pl so all lines are processed, not just the firstBruce Momjian2012-07-06
| | | | | | | match, so files that contain embedded copyrights are updated, e.g. pgsql/help.c. Backpatch to 9.2.
* Fix copyright.pl to properly skip the .git directory by adding aBruce Momjian2012-07-06
| | | | basename() qualification.
* Fix spacing in copyright.pl after being run with missing regex slashBruce Momjian2012-07-06
| | | | | | (now added). Backpatch to 9.2.
* Fix failure of new wchar->mb functions to advance from pointer.Robert Haas2012-07-05
| | | | Bug spotted by Tom Lane.
* Don't try to trim "../" in join_path_components().Tom Lane2012-07-05
| | | | | | | | | | | | | | | | | | join_path_components() tried to remove leading ".." components from its tail argument, but it was not nearly bright enough to do so correctly unless the head argument was (a) absolute and (b) canonicalized. Rather than try to fix that logic, let's just get rid of it: there is no correctness reason to remove "..", and cosmetic concerns can be taken care of by a subsequent canonicalize_path() call. Per bug #6715 from Greg Davidson. Back-patch to all supported branches. It appears that pre-9.2, this function is only used with absolute paths as head arguments, which is why we'd not noticed the breakage before. However, third-party code might be expecting this function to work in more general cases, so it seems wise to back-patch. In HEAD and 9.2, also make some minor cosmetic improvements to callers.
* Revert part of the previous patch that avoided using PLy_elog().Heikki Linnakangas2012-07-05
| | | | | | | | | | That caused the plpython_unicode regression test to fail on SQL_ASCII encoding, as evidenced by the buildfarm. The reason is that with the patch, you don't get the detail in the error message that you got before. That detail is actually very informative, so rather than just adjust the expected output, let's revert that part of the patch for now to make the buildfarm green again, and figure out some other way to avoid the recursion of PLy_elog() that doesn't lose the detail.
* Fix mapping of PostgreSQL encodings to Python encodings.Heikki Linnakangas2012-07-05
| | | | | | | | | | | | | Windows encodings, "win1252" and so forth, are named differently in Python, like "cp1252". Also, if the PyUnicode_AsEncodedString() function call fails for some reason, use a plain ereport(), not a PLy_elog(), to report that error. That avoids recursion and crash, if PLy_elog() tries to call PLyUnicode_Bytes() again. This fixes bug reported by Asif Naeem. Backpatch down to 9.0, before that plpython didn't even try these conversions. Jan Urbański, with minor comment improvements by me.
* Remove support for using wait3() in place of waitpid().Tom Lane2012-07-05
| | | | | | | | All Unix-oid platforms that we currently support should have waitpid(), since it's in V2 of the Single Unix Spec. Our git history shows that the wait3 code was added to support NextStep, which we officially dropped support for as of 9.2. So get rid of the configure test, and simplify the macro spaghetti in reaper(). Per suggestion from Fujii Masao.
* Fix function argument tab completion for schema-qualified or quoted function ↵Magnus Hagander2012-07-05
| | | | | | names Dean Rasheed, reviewed by Josh Kupershmidt
* Fix missing regex slash that caused perltidy to get confused onBruce Momjian2012-07-04
| | | | | | copyright.pl. Backpatch to 9.2.
* Run newly-configured perltidy script on Perl files.Bruce Momjian2012-07-04
| | | | Run on HEAD and 9.2.
* Reduce messages about implicit indexes and sequences to DEBUG1.Robert Haas2012-07-04
| | | | | Per recent discussion on pgsql-hackers, these messages are too chatty for most users.
* Have pg_dump in binary-upgrade mode properly drop user-createdBruce Momjian2012-07-04
| | | | | | | extensions that might exist in the new empty cluster databases, like plpgsql. Backpatch to 9.2.
* Add wchar -> mb conversion routines.Robert Haas2012-07-04
| | | | | | | | This is infrastructure for Alexander Korotkov's work on indexing regular expression searches. Alexander Korotkov, with a bit of further hackery on the MULE conversion by me
* Increase the maximum initdb-configured value for shared_buffers to 128MB.Robert Haas2012-07-04
| | | | | | | | | | | The old value of 32MB has been around for a very long time, and in the meantime typical system memories have become vastly larger. Also, now that we no longer depend on being able to fit the entirety of our shared memory segment into the system's limit on System V shared memory, there's a much better chance of the higher limit actually proving productive. Per recent discussion on pgsql-hackers.
* Remove duplicate, unnecessary, variable declarationMagnus Hagander2012-07-04
|
* Set the write location in the pg_receivexlog status messagesMagnus Hagander2012-07-04
| | | | | | This makes it possible for the master to track how much data has actually been written my pg_receivexlog - and not just how much has been sent towards it.
* Always treat a standby returning an an invalid flush location as asyncMagnus Hagander2012-07-04
| | | | | | | | This ensures that a standby such as pg_receivexlog will not be selected as sync standby - which would cause the master to block waiting for a location that could never happen. Fujii Masao
* Improve documentation about MULE encoding.Tom Lane2012-07-04
| | | | | | | This commit improves the comments in pg_wchar.h and creates #define symbols for some formerly hard-coded values. No substantive code changes. Tatsuo Ishii and Tom Lane
* Forgot an #include in the previous patch :-(Alvaro Herrera2012-07-03
|
* Have REASSIGN OWNED work on extensions, tooAlvaro Herrera2012-07-03
| | | | | | | | | | | | | | | | | Per bug #6593, REASSIGN OWNED fails when the affected role has created an extension. Even though the user related to the extension is not nominally the owner, its OID appears on pg_shdepend and thus causes problems when the user is to be dropped. This commit adds code to change the "ownership" of the extension itself, not of the contained objects. This is fine because it's currently only called from REASSIGN OWNED, which would also modify the ownership of the contained objects. However, this is not sufficient for a working ALTER OWNER implementation extension. Back-patch to 9.1, where extensions were introduced. Bug #6593 reported by Emiliano Leporati.
* Have copyright tool mention that certain files should be updated in back ↵Bruce Momjian2012-07-03
| | | | branches.
* Remove misleading hints about reducing the System V request size.Robert Haas2012-07-03
| | | | | | Since the request size will now be ~48 bytes regardless of how shared_buffers et. al. are set, much of this advice is no longer relevant.
* Fix a stupid bug I introduced into XLogFlush().Robert Haas2012-07-02
| | | | | Commit f11e8be3e812cdbbc139c1b4e49141378b118dee broke this; it was right in Peter's original patch, but I messed it up before committing.
* Fix position of WalSndWakeupRequest call.Robert Haas2012-07-02
| | | | | | | This avoids discriminating against wal_sync_method = open_sync or open_datasync. Fujii Masao, reviewed by Andres Freund
* Assorted message style improvementsPeter Eisentraut2012-07-02
|
* Fix to_date's handling of year 519.Tom Lane2012-07-02
| | | | | | | | A thinko in commit 029dfdf1157b6d837a7b7211cd35b00c6bcd767c caused the year 519 to be handled differently from either adjacent year, which was not the intention AFAICS. Report and diagnosis by Marc Cousin. In passing, remove redundant re-tests of year value.
* Work a little harder on comments for walsender wakeup patch.Robert Haas2012-07-02
| | | | Per gripe from Tom Lane.
* Make commit_delay much smarter.Robert Haas2012-07-02
| | | | | | | | | | | | | | | | Instead of letting every backend participating in a group commit wait independently, have the first one that becomes ready to flush WAL wait for the configured delay, and let all the others wait just long enough for that first process to complete its flush. This greatly increases the chances of being able to configure a commit_delay setting that actually improves performance. As a side consequence of this change, commit_delay now affects all WAL flushes, rather than just commits. There was some discussion on pgsql-hackers about whether to rename the GUC to, say, wal_flush_delay, but in the absence of consensus I am leaving it alone for now. Peter Geoghegan, with some changes, mostly to the documentation, by me.
* Make walsender more responsive.Robert Haas2012-07-02
| | | | | | | | | | | Per testing by Andres Freund, this improves replication performance and reduces replication latency and latency jitter. I was a bit concerned about moving more work into XLogInsert, but testing seems to show that it's not a problem in practice. Along the way, improve comments for WaitLatchOrSocket. Andres Freund. Review and stylistic cleanup by me.
* Fix race condition in enum value comparisons.Tom Lane2012-07-01
| | | | | | | | | | | | | | | | | | | | | | | | When (re) loading the typcache comparison cache for an enum type's values, use an up-to-date MVCC snapshot, not the transaction's existing snapshot. This avoids problems if we encounter an enum OID that was created since our transaction started. Per report from Andres Freund and diagnosis by Robert Haas. To ensure this is safe even if enum comparison manages to get invoked before we've set a transaction snapshot, tweak GetLatestSnapshot to redirect to GetTransactionSnapshot instead of throwing error when FirstSnapshotSet is false. The existing uses of GetLatestSnapshot (in ri_triggers.c) don't care since they couldn't be invoked except in a transaction that's already done some work --- but it seems just conceivable that this might not be true of enums, especially if we ever choose to use enums in system catalogs. Note that the comparable coding in enum_endpoint and enum_range_internal remains GetTransactionSnapshot; this is perhaps debatable, but if we changed it those functions would have to be marked volatile, which doesn't seem attractive. Back-patch to 9.1 where ALTER TYPE ADD VALUE was added.
* Suppress compiler warnings in readfuncs.c.Tom Lane2012-06-30
| | | | | | | | | | | | | | Commit 7357558fc8866e3a449aa9473c419b593d67b5b6 introduced "(void) token;" into the READ_TEMP_LOCALS() macro, to suppress complaints from gcc 4.6 when the value of token was not used anywhere in a particular node-read function. However, this just moved the warning around: inspection of buildfarm results shows that some compilers are now complaining that token is being read before it's set. Revert the READ_TEMP_LOCALS() macro change and instead put "(void) token;" into READ_NODE_FIELD(), which is the principal culprit for cases where the warning might occur. In principle we might need the same in READ_BITMAPSET_FIELD() and/or READ_LOCATION_FIELD(), but it seems unlikely that a node would consist only of such fields, so I'll leave them alone for now.
* Remove inappropriate semicolons after function definitions.Tom Lane2012-06-30
| | | | | Solaris Studio warns about this, and some compilers might think it's an outright syntax error.
* Declare AnonymousShmem pointer as "void *".Tom Lane2012-06-30
| | | | | | | | The original coding had it as "PGShmemHeader *", but that doesn't offer any notational benefit because we don't dereference it. And it was resulting in compiler warnings on some platforms, notably buildfarm member castoroides, where mmap() and munmap() are evidently declared to take and return "char *".
* Prevent CREATE TABLE LIKE/INHERITS from (mis) copying whole-row Vars.Tom Lane2012-06-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If a CHECK constraint or index definition contained a whole-row Var (that is, "table.*"), an attempt to copy that definition via CREATE TABLE LIKE or table inheritance produced incorrect results: the copied Var still claimed to have the rowtype of the source table, rather than the created table. For the LIKE case, it seems reasonable to just throw error for this situation, since the point of LIKE is that the new table is not permanently coupled to the old, so there's no reason to assume its rowtype will stay compatible. In the inheritance case, we should ideally allow such constraints, but doing so will require nontrivial refactoring of CREATE TABLE processing (because we'd need to know the OID of the new table's rowtype before we adjust inherited CHECK constraints). In view of the lack of previous complaints, that doesn't seem worth the risk in a back-patched bug fix, so just make it throw error for the inheritance case as well. Along the way, replace change_varattnos_of_a_node() with a more robust function map_variable_attnos(), which is capable of being extended to handle insertion of ConvertRowtypeExpr whenever we get around to fixing the inheritance case nicely, and in the meantime it returns a failure indication to the caller so that a helpful message with some context can be thrown. Also, this code will do the right thing with subselects (if we ever allow them in CHECK or indexes), and it range-checks varattnos before using them to index into the map array. Per report from Sergey Konoplev. Back-patch to all supported branches.
* initdb: Update check_need_password for new optionsPeter Eisentraut2012-06-30
| | | | | | Change things so that something like initdb --auth-local=peer --auth-host=md5 does not cause a "must specify a password" error, like initdb -A md5 does.
* Validate xlog record header before enlarging the work area to store it.Heikki Linnakangas2012-06-30
| | | | | | | | | | | | If the record header is garbled, we're now quite likely to notice it before we try to make a bogus memory allocation and run out of memory. That can still happen, if the xlog record is split across pages (we cannot verify the record header until reading the next page in that scenario), but this reduces the chances. An out-of-memory is treated as a corrupt record anyway, so this isn't a correctness issue, just a case of giving a better error message. Per Amit Kapila's suggestion.
* Fix confusion between "size" and "AnonymousShmemSize".Tom Lane2012-06-29
| | | | Noted by Andres Freund. Also improve a couple of comments.
* Initialize shared memory copy of ckptXidEpoch correctly when not in recovery.Heikki Linnakangas2012-06-29
| | | | | | | This bug was introduced by commit 20d98ab6e4110087d1816cd105a40fcc8ce0a307, so backpatch this to 9.0-9.2 like that one. This fixes bug #6710, reported by Tarvi Pillessaar
* Make init-po and update-po recursive make targetsPeter Eisentraut2012-06-29
| | | | | This is for convenience, now that adding recursive targets is much easier than it used to be when the NLS stuff was initially added.
* Fix NOTIFY to cope with I/O problems, such as out-of-disk-space.Tom Lane2012-06-29
| | | | | | | | | | | | | The LISTEN/NOTIFY subsystem got confused if SimpleLruZeroPage failed, which would typically happen as a result of a write() failure while attempting to dump a dirty pg_notify page out of memory. Subsequently, all attempts to send more NOTIFY messages would fail with messages like "Could not read from file "pg_notify/nnnn" at offset nnnnn: Success". Only restarting the server would clear this condition. Per reports from Kevin Grittner and Christoph Berg. Back-patch to 9.0, where the problem was introduced during the LISTEN/NOTIFY rewrite.
* Provide MAP_FAILED if sys/mman.h doesn't.Tom Lane2012-06-28
| | | | | | On old HPUX this has to be #defined to -1. It might be that other values are required on other dinosaur systems, but we'll worry about that when and if we get reports.
* Update outdated commit; xlp_rem_len field is in page header now.Heikki Linnakangas2012-06-28
| | | | Spotted by Amit Kapila
* Further fix install program detectionPeter Eisentraut2012-06-28
| | | | | | The $(or) make function was introduced in GNU make 3.81, so the previous coding didn't work in 3.80. Write it differently, and improve the variable naming to make more sense in the new coding.
* Fix broken mmap failure-detection code, and improve error message.Robert Haas2012-06-28
| | | | | Per an observation by Thom Brown that my previous commit made an overly large shmem allocation crash the server, on Linux.
* Dramatically reduce System V shared memory consumption.Robert Haas2012-06-28
| | | | | | | | | | | | | | | Except when compiling with EXEC_BACKEND, we'll now allocate only a tiny amount of System V shared memory (as an interlock to protect the data directory) and allocate the rest as anonymous shared memory via mmap. This will hopefully spare most users the hassle of adjusting operating system parameters before being able to start PostgreSQL with a reasonable value for shared_buffers. There are a bunch of documentation updates needed here, and we might need to adjust some of the HINT messages related to shared memory as well. But it's not 100% clear how portable this is, so before we write the documentation, let's give it a spin on the buildfarm and see what turns red.
* Add missing space in event_source GUC description.Robert Haas2012-06-28
| | | | | | This has apparently been wrong since event_source was added. Alexander Lakhin
* Make UtilityContainsQuery recurse until it finds a non-utility Query.Tom Lane2012-06-27
| | | | | | | | | | | | | | | | | | The callers of UtilityContainsQuery want it to return a non-utility Query if it returns anything at all. However, since we made CREATE TABLE AS/SELECT INTO into a utility command instead of a variant of SELECT, a command like "EXPLAIN SELECT INTO" results in two nested utility statements. So what we need UtilityContainsQuery to do is drill down to the bottom non-utility Query. I had thought of this possibility in setrefs.c, and fixed it there by looping around the UtilityContainsQuery call; but overlooked that the call sites in plancache.c have a similar issue. In those cases it's notationally inconvenient to provide an external loop, so let's redefine UtilityContainsQuery as recursing down to a non-utility Query instead. Noted by Rushabh Lathia. This is a somewhat cleaned-up version of his proposed patch.