aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* Rename the internal structures of the CREATE TABLE (LIKE ...) facilityPeter Eisentraut2012-01-07
| | | | | | | | | The original implementation of this interpreted it as a kind of "inheritance" facility and named all the internal structures accordingly. This turned out to be very confusing, because it has nothing to do with the INHERITS feature. So rename all the internal parser infrastructure, update the comments, adjust the error messages, and split up the regression tests.
* Use __sync_lock_test_and_set() for spinlocks on ARM, if available.Tom Lane2012-01-07
| | | | | | | | | | | | | | | | Historically we've used the SWPB instruction for TAS() on ARM, but this is deprecated and not available on ARMv6 and later. Instead, make use of a GCC builtin if available. We'll still fall back to SWPB if not, so as not to break existing ports using older GCC versions. Eventually we might want to try using __sync_lock_test_and_set() on some other architectures too, but for now that seems to present only risk and not reward. Back-patch to all supported versions, since people might want to use any of them on more recent ARM chips. Martin Pitt
* Slightly reorganize struct SnapshotData.Robert Haas2012-01-06
| | | | | | | | | This squeezes out a bunch of alignment padding, reducing the size from 72 to 56 bytes on my machine. At least in my testing, this didn't produce any measurable performance improvement, but the space savings seem like enough justification. Andres Freund
* Fix backwards logic in previous commit.Robert Haas2012-01-06
| | | | | I wrote this code before committing it, but managed not to include it in the actual commit.
* Improve behavior of concurrent ALTER TABLE, and do some refactoring.Robert Haas2012-01-06
| | | | | | | | | | | | | | | | | ALTER TABLE (and ALTER VIEW, ALTER SEQUENCE, etc.) now use a RangeVarGetRelid callback to check permissions before acquiring a table lock. We also now use the same callback for all forms of ALTER TABLE, rather than having separate, almost-identical callbacks for ALTER TABLE .. SET SCHEMA and ALTER TABLE .. RENAME, and no callback at all for everything else. I went ahead and changed the code so that no form of ALTER TABLE works on foreign tables; you must use ALTER FOREIGN TABLE instead. In 9.1, it was possible to use ALTER TABLE .. SET SCHEMA or ALTER TABLE .. RENAME on a foreign table, but not any other form of ALTER TABLE, which did not seem terribly useful or consistent. Patch by me; review by Noah Misch.
* Make the number of CLOG buffers adaptive, based on shared_buffers.Robert Haas2012-01-06
| | | | | | | | | | | | Previously, this was hardcoded: we always had 8. Performance testing shows that isn't enough, especially on big SMP systems, so we allow it to scale up as high as 32 when there's adequate memory. On the flip side, when shared_buffers is very small, drop the number of CLOG buffers down to as little as 4, so that we can start the postmaster even when very little shared memory is available. Per extensive discussion with Simon Riggs, Tom Lane, and others on pgsql-hackers.
* Fix pg_restore's direct-to-database mode for INSERT-style table data.Tom Lane2012-01-06
| | | | | | | | | | | | | | | | | | | | | | | | | In commit 6545a901aaf84cb05212bb6a7674059908f527c3, I removed the mini SQL lexer that was in pg_backup_db.c, thinking that it had no real purpose beyond separating COPY data from SQL commands, which purpose had been obsoleted by long-ago fixes in pg_dump's archive file format. Unfortunately this was in error: that code was also used to identify command boundaries in INSERT-style table data, which is run together as a single string in the archive file for better compressibility. As a result, direct-to-database restores from archive files made with --inserts or --column-inserts fail in our latest releases, as reported by Dick Visser. To fix, restore the mini SQL lexer, but simplify it by adjusting the calling logic so that it's only required to cope with INSERT-style table data, not arbitrary SQL commands. This allows us to not have to deal with SQL comments, E'' strings, or dollar-quoted strings, none of which have ever been emitted by dumpTableData_insert. Also, fix the lexer to cope with standard-conforming strings, which was the actual bug that the previous patch was meant to solve. Back-patch to all supported branches. The previous patch went back to 8.2, which unfortunately means that the EOL release of 8.2 contains this bug, but I don't think we're doing another 8.2 release just because of that.
* Fix variable confusion in BufferSync().Robert Haas2012-01-06
| | | | | | | | | As noted by Heikki Linnakangas, the previous coding confused the "flags" variable with the "mask" variable. The affect of this appears to be that unlogged buffers would get written out at every checkpoint rather than only at shutdown time. Although that's arguably an acceptable failure mode, I'm back-patching this change, since it seems like a poor idea to rely on this happening to work.
* Fix breakage from earlier plperl fix.Andrew Dunstan2012-01-05
| | | | | Apparently the perl garbage collector was a bit too eager, so here we control when the new SV is garbage collected.
* pg_dump: Dump foreign options in prettier formatPeter Eisentraut2012-01-05
| | | | | Dump them using line breaks and indentation instead of everything on one line.
* pg_dump: Dump operators with the same name ordered by arityPeter Eisentraut2012-01-05
| | | | | | | pg_dump sorts operators by name, but operators with the same name come out in random order. Now operators with the same name are dumped in the order prefix, postfix, infix. (This is consistent with functions, which are dumped in increasing number of argument order.)
* Improve ALTER DOMAIN / DROP CONSTRAINT with nonexistent constraintPeter Eisentraut2012-01-05
| | | | | | | ALTER DOMAIN / DROP CONSTRAINT on a nonexistent constraint name did not report any error. Now it reports an error. The IF EXISTS option was added to get the usual behavior of ignoring nonexistent objects to drop.
* Work around perl bug in SvPVutf8().Andrew Dunstan2012-01-05
| | | | | | | | | | | Certain things like typeglobs or readonly things like $^V cause perl's SvPVutf8() to die nastily and crash the backend. To avoid that bug we make a copy of the object, which will subsequently be garbage collected. Back patched to 9.1 where we first started using SvPVutf8(). Per -hackers discussion. Original problem reported by David Wheeler.
* Ecpglib stores variables that are used in DECLARE statements in a global list.Michael Meskes2012-01-05
| | | | | | This list is now freed when the last connection has been closed. Closes: #6366
* Make executor's SELECT INTO code save and restore original tuple receiver.Tom Lane2012-01-04
| | | | | | | | | | | | As previously coded, the QueryDesc's dest pointer was left dangling (pointing at an already-freed receiver object) after ExecutorEnd. It's a bit astonishing that it took us this long to notice, and I'm not sure that the known problem case with SQL functions is the only one. Fix it by saving and restoring the original receiver pointer, which seems the most bulletproof way of ensuring any related bugs are also covered. Per bug #6379 from Paul Ramsey. Back-patch to 8.4 where the current handling of SELECT INTO was introduced.
* Made code in ecpg better readable.Michael Meskes2012-01-04
|
* Suggest use of psql when pg_restore gets a text dump.Andrew Dunstan2012-01-03
|
* Use a non-locking initial test in TAS_SPIN on PPC.Tom Lane2012-01-03
| | | | | | | | Further testing convinces me that this is helpful at sufficiently high contention levels, though it's still worrisome that it loses slightly at lower contention levels. Per Manabu Ori.
* Support for building with MS Visual Studio 2010.Andrew Dunstan2012-01-03
| | | | Brar Piening, reviewed by Craig Ringer.
* Another fix for pg_regress: Replace exit_nicely() with exit() plusPeter Eisentraut2012-01-02
| | | | atexit() hook
* pg_regress: Replace exit_nicely() with exit() plus atexit() hookPeter Eisentraut2012-01-02
|
* Fix coerce_to_target_type for coerce_type's klugy handling of COLLATE.Tom Lane2012-01-02
| | | | | | | | | | | | | | | | Because coerce_type recurses into the argument of a CollateExpr, coerce_to_target_type's longstanding code for detecting whether coerce_type had actually done anything (to wit, returned a different node than it passed in) was broken in 9.1. This resulted in unexpected failures in hide_coercion_node; which was not the latter's fault, since it's critical that we never call it on anything that wasn't inserted by coerce_type. (Else we might decide to "hide" a user-written function call.) Fix by removing and replacing the CollateExpr in coerce_to_target_type itself. This is all pretty ugly but I don't immediately see a way to make it nicer. Per report from Jean-Yves F. Barbier.
* Add comment about skipping binary files for copyright changes.Bruce Momjian2012-01-02
|
* Use LWSYNC in place of SYNC/ISYNC in PPC spinlocks, where possible.Tom Lane2012-01-02
| | | | | | | | | | | | | This is allegedly a win, at least on some PPC implementations, according to the PPC ISA documents. However, as with LWARX hints, some PPC platforms give an illegal-instruction failure. Use the same trick as before of assuming that PPC64 platforms will accept it; we might need to refine that based on experience, but there are other projects doing likewise according to google. I did not add an assembler compatibility test because LWSYNC has been around much longer than hint bits, and it seems unlikely that any toolchains currently in use don't recognize it.
* Use 4-byte slock_t on both PPC and PPC64.Tom Lane2012-01-02
| | | | | | | Previously we defined slock_t as 8 bytes on PPC64, but the TAS assembly code uses word-wide operations regardless, so that the second word was just wasted space. There doesn't appear to be any performance benefit in adding the second word, so get rid of it to simplify the code.
* Use mutex hint bit in PPC LWARX instructions, where possible.Tom Lane2012-01-02
| | | | | | | | | | | | | | | The hint bit makes for a small but measurable performance improvement in access to contended spinlocks. On the other hand, some PPC chips give an illegal-instruction failure. There doesn't seem to be a completely bulletproof way to tell whether the hint bit will cause an illegal-instruction failure other than by trying it; but most if not all 64-bit PPC machines should accept it, so follow the Linux kernel's lead and assume it's okay to use it in 64-bit builds. Of course we must also check whether the assembler accepts the command, since even with a recent CPU the toolchain could be old. Patch by Manabu Ori, significantly modified by me.
* Update copyright git skip comment.Bruce Momjian2012-01-01
|
* Skip any .git directory for copyright changes, not just top-level .gitBruce Momjian2012-01-01
| | | | directories. Per suggestion from Andrew Dunstan.
* Revert binary change in copyright year adjustment.Bruce Momjian2012-01-01
|
* Revert binary change in copyright year adjustment.Bruce Momjian2012-01-01
|
* Skip 'ico' and 'bin' extensions in copyright changes.Bruce Momjian2012-01-01
|
* Update copyright notices for year 2012.Bruce Momjian2012-01-01
|
* Don't use tabs in Perl scripts, for consistency.Bruce Momjian2012-01-01
|
* Fix Perl copyright script to skip .git subdirectory; running it onBruce Momjian2012-01-01
| | | | those files corrupts the index.
* Send new protocol keepalive messages to standby servers.Simon Riggs2011-12-31
| | | | | Allows streaming replication users to calculate transfer latency and apply delay via internal functions. No external functions yet.
* Revert "Remove troublesome Asserts in cost_mergejoin()."Tom Lane2011-12-30
| | | | | | | | This reverts commit ff68b256a533b398e3420750f34d161aeee4e099. The recent change to use -fexcess-precision=standard should make those Asserts safe, and does fix a test case that formerly crashed for me, so I think there's no need to have a cross-version difference in the code here.
* Modify tools/pgtest to run the 'make' command from a variable, and defaultBruce Momjian2011-12-30
| | | | to 'make' rather than 'gmake' for the binary name.
* Adjust SP-GiST regression tests to be less locale-sensitive.Tom Lane2011-12-29
| | | | | | | The original test cases gave varying results depending on whether the locale sorts digits before or after letters. Since that's not really what we wish to test here, adjust the test data to not contain any strings beginning with digits. Per report from Pavel Stehule.
* PL/Python: Add argument names to function declarationsPeter Eisentraut2011-12-29
| | | | For easier source reading
* pg_dump: Dump user mappings ordered by user namePeter Eisentraut2011-12-29
| | | | | This is to get a deterministic dump order independent of the order in which the user mappings were created.
* Indicate default format in --help output of pg_dump and pg_basebackupPeter Eisentraut2011-12-28
|
* Standardize treatment of strcmp() return valuePeter Eisentraut2011-12-27
| | | | | Always compare the return value to 0, don't use cute tricks like if (!strcmp(...)).
* Remove support for on_exit()Peter Eisentraut2011-12-27
| | | | | | All supported platforms support the C89 standard function atexit() (SunOS 4 probably being the last one not to), and supporting both makes the code clumsy.
* Run "make all" as a prerequisite of "make check"Peter Eisentraut2011-12-27
| | | | This is the standard behavior but was forgotten in some places.
* Sort compendium lists for msgmergePeter Eisentraut2011-12-27
| | | | | That way, the result of a msgmerge is more deterministic and not dependent on the order in which the files are found.
* Sort file list when creating gettext-filesPeter Eisentraut2011-12-27
| | | | | That way, the created .pot file is more deterministic and not dependent on the order in which the files are found.
* Rethink representation of index clauses' mapping to index columns.Tom Lane2011-12-24
| | | | | | | | | | | | | | | | | | | | | In commit e2c2c2e8b1df7dfdb01e7e6f6191a569ce3c3195 I made use of nested list structures to show which clauses went with which index columns, but on reflection that's a data structure that only an old-line Lisp hacker could love. Worse, it adds unnecessary complication to the many places that don't much care which clauses go with which index columns. Revert to the previous arrangement of flat lists of clauses, and instead add a parallel integer list of column numbers. The places that care about the pairing can chase both lists with forboth(), while the places that don't care just examine one list the same as before. The only real downside to this is that there are now two more lists that need to be passed to amcostestimate functions in case they care about column matching (which btcostestimate does, so not passing the info is not an option). Rather than deal with 11-argument amcostestimate functions, pass just the IndexPath and expect the functions to extract fields from it. That gets us down to 7 arguments which is better than 11, and it seems more future-proof against likely additions to the information we keep about an index path.
* Improve planner's handling of duplicated index column expressions.Tom Lane2011-12-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It's potentially useful for an index to repeat the same indexable column or expression in multiple index columns, if the columns have different opclasses. (If they share opclasses too, the duplicate column is pretty useless, but nonetheless we've allowed such cases since 9.0.) However, the planner failed to cope with this, because createplan.c was relying on simple equal() matching to figure out which index column each index qual is intended for. We do have that information available upstream in indxpath.c, though, so the fix is to not flatten the multi-level indexquals list when putting it into an IndexPath. Then we can rely on the sublist structure to identify target index columns in createplan.c. There's a similar issue for index ORDER BYs (the KNNGIST feature), so introduce a multi-level-list representation for that too. This adds a bit more representational overhead, but we might more or less buy that back by not having to search for matching index columns anymore in createplan.c; likewise btcostestimate saves some cycles. Per bug #6351 from Christian Rudolph. Likely symptoms include the "btree index keys must be ordered by attribute" failure shown there, as well as "operator MMMM is not a member of opfamily NNNN". Although this is a pre-existing problem that can be demonstrated in 9.0 and 9.1, I'm not going to back-patch it, because the API changes in the planner seem likely to break things such as index plugins. The corner cases where this matters seem too narrow to justify possibly breaking things in a minor release.
* Add bytea_agg, parallel to string_agg.Robert Haas2011-12-23
| | | | Pavel Stehule
* Catversion bump for commit 0e4611c0234d89e288a53351f775c59522baed7c.Robert Haas2011-12-22
| | | | It changed the format of stored rules.