summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2014-08-26Show schema names in pg_dump verbose output.Heikki Linnakangas
Fabrízio de Royes Mello, reviewed by Michael Paquier
2014-08-26pg_upgrade: prevent automatic oid assignmentBruce Momjian
Prevent automatic oid assignment when in binary upgrade mode. Also throw an error when contrib/pg_upgrade_support functions are called when not in binary upgrade mode. This prevent automatically-assigned oids from conflicting with later pre-assigned oids coming from the old cluster. It also makes sure oids are preserved in call important cases.
2014-08-26rename macro isTempOrToastNamespace to isTempOrTempToastNamespaceBruce Momjian
Done for clarity
2014-08-26pg_upgrade: use CTE query rather than temp tableBruce Momjian
Now that 8.3 is not supported, we can use a CTE and not temp tables. This allows for auto-oid assignment protection in a future patch.
2014-08-26pg_upgrade docs: update docs for 8.3 support removalBruce Momjian
2014-08-26revert "Throw error for ALTER TABLE RESET of an invalid option"Bruce Momjian
Reverts commits 73d78e11a0f7183c80b93eefbbb6026fe9664015 and b0488e5c4fbfdce8acc989bdc17d9f0ec09ac281. Also reverts pg_upgrade changes.
2014-08-26pg_upgrade: remove support for 8.3 old clustersBruce Momjian
This trims down the code, and is in preparation for hardening pg_upgrade against auto-oid assignment.
2014-08-25pg_upgrade: add SET log_min_error_statement = warningBruce Momjian
Add to commit 73d78e11a0f7183c80b93eefbbb6026fe9664015
2014-08-25Throw error for ALTER TABLE RESET of an invalid optionBruce Momjian
Also adjust pg_upgrade to not use this method for optional TOAST table creation. Patch by Fabrízio de Royes Mello
2014-08-25pg_ctl, pg_upgrade: allow multiple -o/-O options, append themBruce Momjian
Report by Pavel Raiskup
2014-08-25upgrade docs: highlight pg_upgrade, warn about globals preservationBruce Momjian
Also, remove OID preservation mention, mention non-text dump formats Backpatch through 9.4
2014-08-25Revert XactLockTableWait context setup in conditional multixact waitAlvaro Herrera
There's no point in setting up a context error callback when doing conditional lock acquisition, because we never actually wait and so the user wouldn't be able to see the context message anywhere. In fact, this is more in line with what ConditionalXactLockTableWait is doing. Backpatch to 9.4, where this was added.
2014-08-25Use newly added InvalidCommandId instead of 0Alvaro Herrera
The symbol was added by 71901ab6d; the original code was introduced by 6868ed749. Development of both overlapped which is why we apparently failed to notice. This is a (very slight) behavior change, so I'm not backpatching this to 9.4 for now, even though the symbol does exist there.
2014-08-25DefineType: return base type OID, not its arrayAlvaro Herrera
Event triggers want to know the OID of the interesting object created, which is the main type. The array created as part of the operation is just a subsidiary object which is not of much interest.
2014-08-25Have CREATE TABLE AS and REFRESH return an OIDAlvaro Herrera
Other DDL commands are already returning the OID, which is required for future additional event trigger work. This is merely making these commands in line with the rest of utility command support.
2014-08-25More psprintf goodnessAlvaro Herrera
2014-08-25Oops, forgot to "git add" one last changeAlvaro Herrera
2014-08-25Editorial review of SET UNLOGGEDAlvaro Herrera
Add a succint comment explaining why it's correct to change the persistence in this way. Also s/loggedness/persistence/ because native speakers didn't like the latter term. Fabrízio and Álvaro
2014-08-25Add regression tests for SELECT FOR UPDATE/SHARE NOWAIT.Heikki Linnakangas
Thomas Munro
2014-08-25Fix typos in some error messages thrown by extension scripts when fed to psql.Andres Freund
Some of the many error messages introduced in 458857cc missed 'FROM unpackaged'. Also e016b724 and 45ffeb7e forgot to quote extension version numbers. Backpatch to 9.1, just like 458857cc which introduced the messages. Do so because the error messages thrown when the wrong command is copy & pasted aren't easy to understand.
2014-08-25Don't track DEALLOCATE in pg_stat_statements.Heikki Linnakangas
We also don't track PREPARE, nor do we track planning time in general, so let's ignore DEALLOCATE as well for consistency. Backpatch to 9.4, but not further than that. Although it seems unlikely that anyone is relying on the current behavior, this is a behavioral change. Fabien Coelho
2014-08-24Fix another ancient memory-leak bug in relcache.c.Tom Lane
CheckConstraintFetch() leaked a cstring in the caller's context for each CHECK constraint expression it copied into the relcache. Ordinarily that isn't problematic, but it can be during CLOBBER_CACHE testing because so many reloads can happen during a single query; so complicate the code slightly to allow freeing the cstring after use. Per testing on buildfarm member barnacle. This is exactly like the leak fixed in AttrDefaultFetch() by commit 078b2ed291c758e7125d72c3a235f128d40a232b. (Yes, this time I did look for other instances of the same coding pattern :-(.) Like that patch, no back-patch, since it seems unlikely that there's any problem except under very artificial test conditions. BTW, it strikes me that both of these places would require further work comparable to commit ab8c84db2f7af008151b848cf1d6a4672a39eecd, if we ever supported defaults or check constraints on system catalogs: they both assume they are copying into an empty relcache data structure, and that conceivably wouldn't be the case during recursive reloading of a system catalog. This does not seem worth worrying about for the moment, since there is no near-term prospect of supporting any such thing. So I'll just note the possibility for the archives' sake.
2014-08-23doc: Improve pg_restore help outputPeter Eisentraut
Add a note that some options can be specified multiple times to select multiple objects to restore. This replaces the somewhat confusing use of plurals in the option descriptions themselves.
2014-08-22Implement ALTER TABLE .. SET LOGGED / UNLOGGEDAlvaro Herrera
This enables changing permanent (logged) tables to unlogged and vice-versa. (Docs for ALTER TABLE / SET TABLESPACE got shuffled in an order that hopefully makes more sense than the original.) Author: Fabrízio de Royes Mello Reviewed by: Christoph Berg, Andres Freund, Thom Brown Some tweaking by Álvaro Herrera
2014-08-22Fix outdated commentAlvaro Herrera
2014-08-22Fix corner-case behaviors in JSON/JSONB field extraction operators.Tom Lane
Cause the path extraction operators to return their lefthand input, not NULL, if the path array has no elements. This seems more consistent since the case ought to correspond to applying the simple extraction operator (->) zero times. Cause other corner cases in field/element/path extraction to return NULL rather than failing. This behavior is arguably more useful than throwing an error, since it allows an expression index using these operators to be built even when not all values in the column are suitable for the extraction being indexed. Moreover, we already had multiple inconsistencies between the path extraction operators and the simple extraction operators, as well as inconsistencies between the JSON and JSONB code paths. Adopt a uniform rule of returning NULL rather than throwing an error when the JSON input does not have a structure that permits the request to be satisfied. Back-patch to 9.4. Update the release notes to list this as a behavior change since 9.3.
2014-08-22Fix newly introduced misspelling of existence in pg_buffercache.Andres Freund
Peter Geoghegan
2014-08-22Fix comment in pg_basebackup.Heikki Linnakangas
The option is called --tablespace-mapping, not --tablespace. Amit Kapila
2014-08-22Change the way pg_basebackup's tablespace mapping is implemented.Heikki Linnakangas
Previously, we would first create the symlinks the way they are in the original system, and at the end replace them with the mapped symlinks. That never really made much sense, so now we create the symlink pointing to the correct location to begin with, so that there's no need to fix them at the end. The old coding didn't work correctly on Windows, because Windows junction points look more like directories than files, and ought to be removed with rmdir rather than unlink. Also, it incorrectly used "%d" rather than "%u" to print an Oid, but that's gone now. Report and patch by Amit Kapila, with minor changes by me. Reviewed by MauMau. Backpatch to 9.4, where the --tablespace feature was added.
2014-08-22Fix whitespacePeter Eisentraut
2014-08-21Rework 'MOVE ALL' to 'ALTER .. ALL IN TABLESPACE'Stephen Frost
As 'ALTER TABLESPACE .. MOVE ALL' really didn't change the tablespace but instead changed objects inside tablespaces, it made sense to rework the syntax and supporting functions to operate under the 'ALTER (TABLE|INDEX|MATERIALIZED VIEW)' syntax and to be in tablecmds.c. Pointed out by Alvaro, who also suggested the new syntax. Back-patch to 9.4.
2014-08-21Add pinning_backends column to the pg_buffercache extension.Andres Freund
The new column shows how many backends have a buffer pinned. That can be useful during development or to diagnose production issues e.g. caused by vacuum waiting for cleanup locks. To handle upgrades transparently - the extension might be used in views - deal with callers expecting the old number of columns. Reviewed by Fujii Masao and Rajeev rastogi.
2014-08-21Add #define INT64_MODIFIER for the printf length modifier for 64-bit ints.Heikki Linnakangas
We have had INT64_FORMAT and UINT64_FORMAT for a long time, but that's not good enough if you want something more exotic, like "%20lld". Abhijit Menon-Sen, per Andres Freund's suggestion.
2014-08-20More regression test cases for json/jsonb extraction operators.Tom Lane
Cover some cases I omitted before, such as null and empty-string elements in the path array. This exposes another inconsistency: json_extract_path complains about empty path elements but jsonb_extract_path does not.
2014-08-20Fix core dump in jsonb #> operator, and add regression test cases.Tom Lane
jsonb's #> operator segfaulted (dereferencing a null pointer) if the RHS was a zero-length array, as reported in bug #11207 from Justin Van Winkle. json's #> operator returns NULL in such cases, so for the moment let's make jsonb act likewise. Also add a bunch of regression test queries memorializing the -> and #> operators' behavior for this and other corner cases. There is a good argument for changing some of these behaviors, as they are not very consistent with each other, and throwing an error isn't necessarily a desirable behavior for operators that are likely to be used in indexes. However, everybody can agree that a core dump is the Wrong Thing, and we need test cases even if we decide to change their expected output later.
2014-08-20pg_upgrade: adjust logging to use QUERY_ALLOC lengthsBruce Momjian
Allows the logging to print the entire text of failed queries, rather than a truncated version.
2014-08-20Use comma+space as the separator in the default search_path.Heikki Linnakangas
While the space is optional, it seems nicer to be consistent with what you get if you do "SET search_path=...". SET always normalizes the separator to be comma+space. Christoph Martin
2014-08-19Revert "Fix bug in checking of IDENTIFY_SYSTEM result."Fujii Masao
This reverts commit 083d29c65b7897f90c70e6dc0a4240a5fa75c8f2. The commit changed the code so that it causes an errors when IDENTIFY_SYSTEM returns three columns. But which prevents us from using the replication-related utilities against the server with older version. This is not what we want. For that compatibility, we allow the utilities to receive three columns as the result of IDENTIFY_SYSTEM eventhough it actually returns four columns in 9.4 or later. Pointed out by Andres Freund.
2014-08-19Fix bug in checking of IDENTIFY_SYSTEM result.Fujii Masao
5a991ef8692ed0d170b44958a81a6bd70e90585 added new column into the result of IDENTIFY_SYSTEM command. But it was not reflected into several codes checking that result. Specifically though the number of columns in the result was increased to 4, it was still compared with 3 in some replication codes. Back-patch to 9.4 where the number of columns in IDENTIFY_SYSTEM result was increased. Report from Michael Paquier
2014-08-19Install libpq DLL with $(INSTALL_SHLIB).Noah Misch
Programs need execute permission on a DLL file to load it. MSYS "install" ignores the mode argument, and our Cygwin build statically links libpq into programs. That explains the lack of buildfarm trouble. Back-patch to 9.0 (all supported versions).
2014-08-19Finish adding file version information to installed Windows binaries.Noah Misch
In support of this, have the MSVC build follow GNU make in preferring GNUmakefile over Makefile when a directory contains both. Michael Paquier, reviewed by MauMau.
2014-08-19Replace a few strncmp() calls with strlcpy().Noah Misch
strncmp() is a specialized API unsuited for routine copying into fixed-size buffers. On a system where the length of a single filename can exceed MAXPGPATH, the pg_archivecleanup change prevents a simple crash in the subsequent strlen(). Few filesystems support names that long, and calling pg_archivecleanup with untrusted input is still not a credible use case. Therefore, no back-patch. David Rowley
2014-08-19Make pg_service.conf sample LDIF more portable.Noah Misch
The aboriginal sample placed connection parameters in groupOfUniqueNames/uniqueMember. OpenLDAP, at least as early as version 2.4.23, rejects uniqueMember entries that do not conform to the syntax for a distinguished name. Use device/description, which is free-form. Back-patch to 9.4 for web site visibility.
2014-08-19Document new trigger-related forms of ALTER FOREIGN TABLE.Noah Misch
Oversight in commit 7cbe57c34dec4860243e6d0f81738cfbb6e5d069. Back-patch to 9.4, where that commit first appeared. In passing, release-note the FDW API postcondition change from the same commit.
2014-08-18Adjust Release Notes to reflect holding off wrapped expanded mode until 9.5 ↵Greg Stark
(thanks Michael Paquier)
2014-08-18Fix further concerns about psql wrapping in expanded mode havingGreg Stark
collateral damage on other formats, by Sergey Muraviov.
2014-08-18Reorganize functions in be-secure-openssl.cHeikki Linnakangas
Move the functions within the file so that public interface functions come first, followed by internal functions. Previously, be_tls_write was first, then internal stuff, and finally the rest of the public interface, which clearly didn't make much sense. Per Andres Freund's complaint.
2014-08-18Fix obsolete mention of non-int64 support in CREATE SEQUENCE documentation.Tom Lane
The old text explained what happened if we didn't have working int64 arithmetic. Since that case has been explicitly rejected by configure since 8.4.3, documenting it in the 9.x branches can only produce confusion.
2014-08-18Use ISO 8601 format for dates converted to JSON, too.Tom Lane
Commit f30015b6d794c15d52abbb3df3a65081fbefb1ed made this happen for timestamp and timestamptz, but it seems pretty inconsistent to not do it for simple dates as well. (In passing, I re-pgindent'd json.c.)
2014-08-18Add missing index terms for replication commands in the document.Fujii Masao
Previously only CREATE_REPLICATION_SLOT was exposed as an index term. That's odd and there is no reason not to add index terms for other replication commands. Back-patch to 9.4.