summaryrefslogtreecommitdiff
path: root/src/bin/scripts
AgeCommit message (Collapse)Author
2014-07-21Translation updatesPeter Eisentraut
2014-07-15Add missing source files to nls.mkPeter Eisentraut
These are files under common/ that have been moved around. Updating these manually is not satisfactory, but it's the only solution at the moment.
2014-05-06pgindent run for 9.4Bruce Momjian
This includes removing tabs after periods in C comments, which was applied to back branches, so this change should not effect backpatching.
2014-04-25Clean up temp installations after client program tests.Tom Lane
Commit 7d0f493f19607774fdccb1a1ea06fdd96a3d9698 added infrastructure to perform tests in assorted src/bin/ subdirectories, but forgot to teach "make clean" to clean up the detritus the tests leave behind.
2014-04-15vacuumdb: Add option --analyze-in-stagesPeter Eisentraut
Add vacuumdb option --analyze-in-stages which runs ANALYZE three times with different configuration settings, adopting the logic from the analyze_new_cluster.sh script that pg_upgrade generates. That way, users of pg_dump/pg_restore can also use that functionality. Change pg_upgrade to create the script so that it calls vacuumdb instead of implementing the logic itself.
2014-04-14Add TAP tests for client programsPeter Eisentraut
Reviewed-by: Pavel Stěhule <pavel.stehule@gmail.com> Reviewed-by: Erik Rijkers <er@xs4all.nl>
2014-02-10scripts: Remove newlines from end of generated SQLPeter Eisentraut
This results in spurious empty lines in the server log. Instead, add the newlines only when printing out the --echo output. In some cases, this was already done, leading to two newlines being printed. Clean that up as well. From: Fabrízio de Royes Mello <fabriziomello@gmail.com>
2014-01-10Move username lookup functions from /port to /commonBruce Momjian
Per suggestion from Peter E and Alvaro
2014-01-07Update copyright for 2014Bruce Momjian
Update all files in head, and files COPYRIGHT and legal.sgml in all back branches.
2014-01-04Fix translatability markings in psql, and add defenses against future bugs.Tom Lane
Several previous commits have added columns to various \d queries without updating their translate_columns[] arrays, leading to potentially incorrect translations in NLS-enabled builds. Offenders include commit 893686762 (added prosecdef to \df+), c9ac00e6e (added description to \dc+) and 3b17efdfd (added description to \dC+). Fix those cases back to 9.3 or 9.2 as appropriate. Since this is evidently more easily missed than one would like, in HEAD also add an Assert that the supplied array is long enough. This requires an API change for printQuery(), so it seems inappropriate for back branches, but presumably all future changes will be tested in HEAD anyway. In HEAD and 9.3, also clean up a whole lot of sloppiness in the emitted SQL for \dy (event triggers): lack of translatability due to failing to pass words-to-be-translated through gettext_noop(), inadequate schema qualification, and sloppy formatting resulting in unnecessarily ugly -E output. Peter Eisentraut and Tom Lane, per bug #8702 from Sergey Burladyan
2013-12-18Fix incorrect error message reported for non-existent usersBruce Momjian
Previously, lookups of non-existent user names could return "Success"; it will now return "User does not exist" by resetting errno. This also centralizes the user name lookup code in libpgport. Report and analysis by Nicolas Marchildon; patch by me
2013-12-11Add a new option, -g, to createuser, to add membership in a role.Robert Haas
Chistopher Browne, reviewed by Sameer Thakur, Amit Kapila, and Peter Eisentraut.
2013-12-02Translation updatesPeter Eisentraut
2013-11-21Fix pg_isready to handle -d option properly.Fujii Masao
Previously, -d option for pg_isready was broken. When the name of the database was specified by -d option, pg_isready failed with an error. When the conninfo specified by -d option contained the setting of the host name but not Numeric IP address (i.e., hostaddr), pg_isready displayed wrong connection message. -d option could not handle a valid URI prefix at all. This commit fixes these bugs of pg_isready. Backpatch to 9.3, where pg_isready was introduced. Per report from Josh Berkus and Robert Haas. Original patch by Fabrízio de Royes Mello, heavily modified by me.
2013-11-18Replace appendPQExpBuffer(..., <constant>) with appendPQExpBufferStrHeikki Linnakangas
Arguably makes the code a bit more readable, and might give a small performance gain. David Rowley
2013-10-07Translation updatesPeter Eisentraut
2013-09-02Translation updatesPeter Eisentraut
2013-08-18Translation updatesPeter Eisentraut
2013-07-15Fix PQconninfoParse error message handlingPeter Eisentraut
The returned error message already includes a newline, but the callers were adding their own when printing it out.
2013-07-14pg_isready: Message improvementPeter Eisentraut
2013-07-07pg_isready: Make --help output more consistent with other utilitiesPeter Eisentraut
2013-06-24Translation updatesPeter Eisentraut
2013-06-11Fix pg_isready to handle conninfo properly.Fujii Masao
pg_isready displays the host name and the port number that it uses to connect to the server. So far, pg_isready didn't use the conninfo specified in -d option for calculating those host name and port number. This can lead to wrong display to a user. This commit changes pg_isready so that it uses the conninfo for that calculation. Original patch by Phil Sorber, modified by me.
2013-05-31Add new source files to nls.mkPeter Eisentraut
2013-05-29pgindent run for release 9.3Bruce Momjian
This is the first run of the Perl-based pgindent script. Also update pgindent instructions.
2013-05-05Translation updatesPeter Eisentraut
2013-03-17Move pqsignal() to libpgport.Tom Lane
We had two copies of this function in the backend and libpq, which was already pretty bogus, but it turns out that we need it in some other programs that don't use libpq (such as pg_test_fsync). So put it where it probably should have been all along. The signal-mask-initialization support in src/backend/libpq/pqsignal.c stays where it is, though, since we only need that in the backend.
2013-03-06Add fe_memutils.c to nls.mk where usedPeter Eisentraut
2013-02-12Create libpgcommon, and move pg_malloc et al to itAlvaro Herrera
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.
2013-02-08scripts: Add build prerequisite on libpgportPeter Eisentraut
Without this, building in src/bin/scripts directly will fail if libpgport wasn't built first. Other bin components are handled the same way. Phil Sorber
2013-01-25Make it easy to time out pg_isready, and make the default 3 seconds.Robert Haas
Along the way, add a missing line to the help message. Phil Sorber, reviewed by Fujii Masao
2013-01-23pg_isreadyRobert Haas
New command-line utility to test whether a server is ready to accept connections. Phil Sorber, reviewed by Michael Paquier and Peter Eisentraut
2013-01-17Support multiple -t/--table arguments for more commandsMagnus Hagander
On top of the previous support in pg_dump, add support to specify multiple tables (by using the -t option multiple times) to pg_restore, clsuterdb, reindexdb and vacuumdb. Josh Kupershmidt, reviewed by Karl O. Pinc
2013-01-01Update copyrights for 2013Bruce Momjian
Fully update git head, and update back branches in ./COPYRIGHT and legal.sgml files.
2012-10-12In our source code, make a copy of getopt's 'optarg' string arguments,Bruce Momjian
rather than just storing a pointer.
2012-10-02Work around unportable behavior of malloc(0) and realloc(NULL, 0).Tom Lane
On some platforms these functions return NULL, rather than the more common practice of returning a pointer to a zero-sized block of memory. Hack our various wrapper functions to hide the difference by substituting a size request of 1. This is probably not so important for the callers, who should never touch the block anyway if they asked for size 0 --- but it's important for the wrapper functions themselves, which mistakenly treated the NULL result as an out-of-memory failure. This broke at least pg_dump for the case of no user-defined aggregates, as per report from Matthew Carrington. Back-patch to 9.2 to fix the pg_dump issue. Given the lack of previous complaints, it seems likely that there is no live bug in previous releases, even though some of these functions were in place before that.
2012-10-02Standardize naming of malloc/realloc/strdup wrapper functions.Tom Lane
We had a number of variants on the theme of "malloc or die", with the majority named like "pg_malloc", but by no means all. Standardize on the names pg_malloc, pg_malloc0, pg_realloc, pg_strdup. Get rid of pg_calloc entirely in favor of using pg_malloc0. This is an essentially cosmetic change, so no back-patch. (I did find a couple of places where psql and pg_dump were using plain malloc or strdup instead of the pg_ versions, but they don't look significant enough to bother back-patching.)
2012-09-06Fix "too many arguments" messages not to index off the end of argv[].Robert Haas
This affects initdb, clusterdb, reindexdb, and vacuumdb in master and 9.2; in earlier branches, only initdb is affected.
2012-06-18Make documentation of --help and --version options more consistentPeter Eisentraut
Before, some places didn't document the short options (-? and -V), some documented both, some documented nothing, and they were listed in various orders. Now this is hopefully more consistent and complete.
2012-06-10Run pgindent on 9.2 source tree in preparation for first 9.3Bruce Momjian
commit-fest.
2012-04-17Don't override arguments set via options with positional arguments.Andrew Dunstan
A number of utility programs were rather careless about paremeters that can be set via both an option argument and a positional argument. This leads to results which can violate the Principal Of Least Astonishment. These changes refuse to use positional arguments to override settings that have been made via positional arguments. The changes are backpatched to all live branches.
2012-03-21Improve connectMaintenanceDatabase() error reporting.Robert Haas
The prior coding instructs the user to pick an alternative maintenance database, but this is overly clever, since it obscures whatever the real cause of the failure is. Josh Kupershmidt
2012-02-07createuser: Disable prompting by defaultPeter Eisentraut
Do not prompt when options were not specified. Assume --no-createdb, --no-createrole, --no-superuser by default. Also disable prompting for user name in dropdb, unless --interactive was specified. reviewed by Josh Kupershmidt
2012-01-01Update copyright notices for year 2012.Bruce Momjian
2011-12-06Make command-line tools smarter about finding a DB to connect to.Robert Haas
If unable to connect to "postgres", try "template1". This allows things to work more smoothly in the case where the postgres database has been dropped. And just in case that's not good enough, also allow the user to specify a maintenance database to be used for the initial connection, to cover the case where neither postgres nor template1 is suitable.
2011-09-23Add --{no-,}replication flags to createuser.Robert Haas
Fujii Masao, reviewed by Cédric Villemain, with some doc changes by me.
2011-09-10Remove double-quoting of table names in clusterdb. BACKWARD COMPABILITYBruce Momjian
BREAKAGE. Remove double-quoting of index/table names in reindexdb. BACKWARD COMPABILITY BREAKAGE. Document thate user/database names are preserved with double-quoting by command-line tools like vacuumdb.
2011-09-05Adjust translator comment format to xgettext expectationsAlvaro Herrera
2011-08-30Add --if-exists option to dropdb and dropuser.Robert Haas
Josh Kupershmidt, with some further editing by me.
2011-08-26Add markers.Bruce Momjian