aboutsummaryrefslogtreecommitdiff
path: root/contrib/pg_upgrade/exec.c
Commit message (Collapse)AuthorAge
* Create libpgcommon, and move pg_malloc et al to itAlvaro Herrera2013-02-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | libpgcommon is a new static library to allow sharing code among the various frontend programs and backend; this lets us eliminate duplicate implementations of common routines. We avoid libpgport, because that's intended as a place for porting issues; per discussion, it seems better to keep them separate. The first use case, and the only implemented by this patch, is pg_malloc and friends, which many frontend programs were already using. At the same time, we can use this to provide palloc emulation functions for the frontend; this way, some palloc-using files in the backend can also be used by the frontend cleanly. To do this, we change palloc() in the backend to be a function instead of a macro on top of MemoryContextAlloc(). This was previously believed to cause loss of performance, but this implementation has been tweaked by Tom and Andres so that on modern compilers it provides a slight improvement over the previous one. This lets us clean up some places that were already with localized hacks. Most of the pg_malloc/palloc changes in this patch were authored by Andres Freund. Zoltán Böszörményi also independently provided a form of that. libpgcommon infrastructure was authored by Álvaro.
* pg_upgrade: detect stale postmaster.pid lock filesBruce Momjian2013-01-24
| | | | | | | If the postmaster.pid lock file exists, try starting/stopping the cluster to check if the lock file is valid. Per request from Tom.
* Update copyrights for 2013Bruce Momjian2013-01-01
| | | | | Fully update git head, and update back branches in ./COPYRIGHT and legal.sgml files.
* In pg_upgrade, dump each database separately and useBruce Momjian2012-11-30
| | | | | | --single-transaction to restore each database schema. This yields performance improvements for databases with many tables. Also, remove split_old_dump() as it is no longer needed.
* pg_upgrade: Remove check for pg_configPeter Eisentraut2012-09-18
| | | | | | It is no longer used, but was still being checked for. bug #7548 from Reinhard Max
* In pg_upgrade, try a few times to open a log file.Andrew Dunstan2012-09-05
| | | | | | | | | | | | | | If we call pg_ctl stop, the server might continue and thus hold a log file for a short time after it has deleted its pid file, (which is when pg_ctl will exit), and so a subsequent attempt to open the log file might fail. We therefore try to open it a few times, sleeping one second between tries, to give the server time to exit. This corrects an error that was observed on the buildfarm. Backpatched to 9.2,
* In pg_upgrade, document why we can't issue \n\n in the command logfileBruce Momjian2012-09-05
| | | | | | | on Windows. Slightly cleanup log output on Windows given this restriction. Backpatch to 9.2.
* Fix bugs in exec.c that prevented pg_upgrade working in Windows.Andrew Dunstan2012-09-03
| | | | | Backpatch to 9.2 - code before that is quite different and should not have these defects.
* pg_upgrade: Fix exec_prog API to be less flakyAlvaro Herrera2012-08-27
| | | | | | | | | | The previous signature made it very easy to pass something other than the printf-format specifier in the corresponding position, without any warning from the compiler. While at it, move some of the escaping, redirecting and quoting responsibilities from the callers into exec_prog() itself. This makes the callsites cleaner.
* Fix pg_upgrade file share violation on Windows created by the commitBruce Momjian2012-08-07
| | | | | | | | 4741e9afb93f0d769655b2d18c2b73b86f281010. This was done by adding an optional second log file parameter to exec_prog(), and closing and reopening the log file between system() calls. Backpatch to 9.2.
* Make the pg_upgrade log files contain actual commandsAlvaro Herrera2012-06-29
| | | | | | Now the log file not only contains the output from commands executed by system(), but also what command it was in the first place. This arrangement makes debugging a lot simpler.
* Run pgindent on 9.2 source tree in preparation for first 9.3Bruce Momjian2012-06-10
| | | | commit-fest.
* Silence compiler warning about uninitialized variable.Tom Lane2012-03-27
|
* In pg_upgrade, add various logging improvements:Bruce Momjian2012-03-12
| | | | | | | | | | | add ability to control permissions of created files have psql echo its queries for easier debugging output four separate log files, and delete them on success add -r/--retain option to keep log files after success make logs file append-only remove -g/-G/-l logging options sugggest tailing appropriate log file on failure enhance -v/--verbose behavior
* Update copyright notices for year 2012.Bruce Momjian2012-01-01
|
* Add postgres.h to *.c files for pg_upgrade, ltree, and btree_gist, andBruce Momjian2011-08-26
| | | | | | remove from local *.h files. Per suggestion from Alvaro.
* Fix pg_update to properly test for the data directory's existence onBruce Momjian2011-07-30
| | | | | | Win32. Backpatch to 9.1.
* In pg_upgrade on Windows, check if the directory is writable by actuallyBruce Momjian2011-07-24
| | | | | | | creating and removing a file because access() doesn't work on that platform. Backpatch to 9.1 where this check was added.
* Make pg_upgrade output more consistent with project stylePeter Eisentraut2011-07-12
| | | | | | Add errno-based output to error messages where appropriate, reformat blocks to about 72 characters per line, use spaces instead of tabs for indentation, and other style adjustments.
* Pgindent run before 9.1 beta2.Bruce Momjian2011-06-09
|
* In pg_upgrade, clean up handling of invalid directory specification byBruce Momjian2011-05-18
| | | | checking the stat() errno value more strictly.
* Improve pg_upgrade error reporting if the bin or data directories do notBruce Momjian2011-05-18
| | | | exist or are not directories.
* Improve pg_upgrade X_OK comment.Bruce Momjian2011-05-18
|
* Fix pg_upgrade build problem on Windows when using X_OK accessBruce Momjian2011-05-18
| | | | permission check on the current directory.
* Update pg_upgrade directory check error message.Bruce Momjian2011-05-16
|
* Add pg_upgrade check to make sure the user has full access permission inBruce Momjian2011-05-16
| | | | the current directory; if not, throw an error.
* Adjust pg_upgrade FATAL error messages to have consistent newlines.Bruce Momjian2011-05-06
| | | | Also adjust some error message capitalization for consistency.
* pgindent run before PG 9.1 beta 1.Bruce Momjian2011-04-10
|
* Repair multiple breakage in Windows-specific code for appending '.exe'.Tom Lane2011-02-02
|
* Simplify pg_upgrade checking of executable permissions.Bruce Momjian2011-02-02
|
* Stamp copyrights for year 2011.Bruce Momjian2011-01-01
|
* In pg_upgrade, remove use of whichCluster, and just pass old/new clusterBruce Momjian2011-01-01
| | | | | | | pointers, which simplifies the code. This was not possible in 9.0 because everything was in a single nested struct, but is possible now. Per suggestion from Tom.
* Improve pg_upgrade's checks for required executables.Tom Lane2010-12-29
| | | | | | | | | | | | | | Don't insist on pg_dumpall and psql being present in the old cluster, since they are not needed. Do insist on pg_resetxlog being present (in both old and new), since we need it. Also check for pg_config, but only in the new cluster. Remove the useless attempt to call pg_config in the old cluster; we don't need to know the old value of --pkglibdir. (In the case of a stripped-down migration installation there might be nothing there to look at anyway, so any future change that might reintroduce that need would have to be considered carefully.) Per my attempts to build a minimal previous-version installation to support pg_upgrade.
* Clean up some copied-and-pasted code in pg_upgrade.Tom Lane2010-12-11
| | | | | | | | | | | 1. Don't reimplement S_ISDIR() and S_ISREG() badly. 2. Don't reimplement access() badly. This code appears to have been copied from ancient versions of the corresponding backend routines, and not patched to incorporate subsequent fixes (see my commits of 2008-03-31 and 2010-01-14 respectively). It might be a good idea to change it to just *call* those routines, but for now I'll just transpose these fixes over.
* Pgindent run on pg_upgrade source after restructuring.Bruce Momjian2010-10-19
|
* Restructure the pg_upgrade code to use several global structures ratherBruce Momjian2010-10-19
| | | | than packing everything into 'ctx' and passing that to every function.
* Remove cvs keywords from all files.Magnus Hagander2010-09-20
|
* In pg_upgrade, report /bin directory checks independent of /data checks.Bruce Momjian2010-07-13
|
* pgindent run for 9.0, second runBruce Momjian2010-07-06
|
* Make pg_upgrade copyrights just 2010, not 2010-2010.Bruce Momjian2010-07-03
|
* Add copyrights to pg_upgrade and pg_upgrade_tools files, per Tom.Bruce Momjian2010-07-03
|
* Add CVS tags to pg_upgrade and pg_upgrade_support files, per requestBruce Momjian2010-07-03
| | | | from Tom.
* Use NAMEDATALEN instead of local define.Bruce Momjian2010-05-14
| | | | | | Modify path separators for Win32. Per ideas from Takahiro Itagaki
* Remove all mentions of EnterpriseDB Advanced Server from pg_upgrade;Bruce Momjian2010-05-13
| | | | EDB must maintain their own patch set for this.
* Assorted fixes to make pg_upgrade build on MSVC.Magnus Hagander2010-05-13
| | | | | | | | | * There is no chmod() on Windows. * Must always use the 3-parameter version of open() * There is no dynloader.h - but it also appears unnecessary on all platforms * Don't include shlobj.h because it causes compile errors, and from what I can see it's not actually used. This may need to be added back for mingw and/or cygwin in the worst case.
* Add pg_upgrade to /contrib; will be in 9.0 beta2.Bruce Momjian2010-05-12
Add documentation. Supports migration from PG 8.3 and 8.4.