summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2012-01-10Fix typosPeter Eisentraut
2012-01-10Support CREATE TABLE (LIKE ...) with foreign tables and viewsPeter Eisentraut
Composite types are not yet supported, because parserOpenTable() rejects them.
2012-01-10pg_dump: Dump foreign options in sorted orderPeter Eisentraut
2012-01-09Fix pathname in pgindent README.Robert Haas
Kevin Grittner
2012-01-09Add .gitignore file for entabMagnus Hagander
Kevin Grittner
2012-01-09Fix comment languageMagnus Hagander
Per comment from Heikki
2012-01-09Fix pg_basebackup for keepalive messagesMagnus Hagander
Teach pg_basebackup in streaming mode to deal with keepalive messages. Also change the order of checks to complain at the message rather than block size when a new message is introduced. In passing, switch to using sizeof() instead of hardcoded sizes for WAL protocol structs.
2012-01-07Rename the internal structures of the CREATE TABLE (LIKE ...) facilityPeter Eisentraut
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.
2012-01-07Use __sync_lock_test_and_set() for spinlocks on ARM, if available.Tom Lane
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
2012-01-06Slightly reorganize struct SnapshotData.Robert Haas
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
2012-01-06Fix backwards logic in previous commit.Robert Haas
I wrote this code before committing it, but managed not to include it in the actual commit.
2012-01-06Improve behavior of concurrent ALTER TABLE, and do some refactoring.Robert Haas
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.
2012-01-06Make the number of CLOG buffers adaptive, based on shared_buffers.Robert Haas
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.
2012-01-06Fix pg_restore's direct-to-database mode for INSERT-style table data.Tom Lane
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.
2012-01-06Fix variable confusion in BufferSync().Robert Haas
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.
2012-01-05Fix breakage from earlier plperl fix.Andrew Dunstan
Apparently the perl garbage collector was a bit too eager, so here we control when the new SV is garbage collected.
2012-01-05pg_dump: Dump foreign options in prettier formatPeter Eisentraut
Dump them using line breaks and indentation instead of everything on one line.
2012-01-05pg_dump: Dump operators with the same name ordered by arityPeter Eisentraut
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.)
2012-01-05Improve ALTER DOMAIN / DROP CONSTRAINT with nonexistent constraintPeter Eisentraut
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.
2012-01-05Work around perl bug in SvPVutf8().Andrew Dunstan
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.
2012-01-05Ecpglib stores variables that are used in DECLARE statements in a global list.Michael Meskes
This list is now freed when the last connection has been closed. Closes: #6366
2012-01-04Make executor's SELECT INTO code save and restore original tuple receiver.Tom Lane
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.
2012-01-04Made code in ecpg better readable.Michael Meskes
2012-01-03Suggest use of psql when pg_restore gets a text dump.Andrew Dunstan
2012-01-03Use a non-locking initial test in TAS_SPIN on PPC.Tom Lane
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.
2012-01-03Support for building with MS Visual Studio 2010.Andrew Dunstan
Brar Piening, reviewed by Craig Ringer.
2012-01-02Another fix for pg_regress: Replace exit_nicely() with exit() plusPeter Eisentraut
atexit() hook
2012-01-02pg_regress: Replace exit_nicely() with exit() plus atexit() hookPeter Eisentraut
2012-01-02Fix coerce_to_target_type for coerce_type's klugy handling of COLLATE.Tom Lane
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.
2012-01-02Add comment about skipping binary files for copyright changes.Bruce Momjian
2012-01-02Use LWSYNC in place of SYNC/ISYNC in PPC spinlocks, where possible.Tom Lane
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.
2012-01-02Use 4-byte slock_t on both PPC and PPC64.Tom Lane
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.
2012-01-02Use mutex hint bit in PPC LWARX instructions, where possible.Tom Lane
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.
2012-01-01Update copyright git skip comment.Bruce Momjian
2012-01-01Skip any .git directory for copyright changes, not just top-level .gitBruce Momjian
directories. Per suggestion from Andrew Dunstan.
2012-01-01Revert binary change in copyright year adjustment.Bruce Momjian
2012-01-01Revert binary change in copyright year adjustment.Bruce Momjian
2012-01-01Skip 'ico' and 'bin' extensions in copyright changes.Bruce Momjian
2012-01-01Update copyright notices for year 2012.Bruce Momjian
2012-01-01Don't use tabs in Perl scripts, for consistency.Bruce Momjian
2012-01-01Fix Perl copyright script to skip .git subdirectory; running it onBruce Momjian
those files corrupts the index.
2011-12-31Send new protocol keepalive messages to standby servers.Simon Riggs
Allows streaming replication users to calculate transfer latency and apply delay via internal functions. No external functions yet.
2011-12-30Revert "Remove troublesome Asserts in cost_mergejoin()."Tom Lane
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.
2011-12-30Modify tools/pgtest to run the 'make' command from a variable, and defaultBruce Momjian
to 'make' rather than 'gmake' for the binary name.
2011-12-29Adjust SP-GiST regression tests to be less locale-sensitive.Tom Lane
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.
2011-12-29PL/Python: Add argument names to function declarationsPeter Eisentraut
For easier source reading
2011-12-29pg_dump: Dump user mappings ordered by user namePeter Eisentraut
This is to get a deterministic dump order independent of the order in which the user mappings were created.
2011-12-28Indicate default format in --help output of pg_dump and pg_basebackupPeter Eisentraut
2011-12-27Standardize treatment of strcmp() return valuePeter Eisentraut
Always compare the return value to 0, don't use cute tricks like if (!strcmp(...)).
2011-12-27Remove support for on_exit()Peter Eisentraut
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.