summaryrefslogtreecommitdiff
path: root/src/bin/scripts
AgeCommit message (Collapse)Author
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
2011-08-17Translation updatesPeter Eisentraut
2011-06-29Unify spelling of "canceled", "canceling", "cancellation"Peter Eisentraut
We had previously (af26857a2775e7ceb0916155e931008c2116632f) established the U.S. spellings as standard.
2011-06-26Make _ be automatically included in GETTEXT_TRIGGERSPeter Eisentraut
Since it's globally defined in c.h, it should be treated as a gettext trigger everywhere.
2011-06-26Replace := by = in nls.mk filesPeter Eisentraut
It currently doesn't make a difference, but it's inconsistent with most other usage, and it might interfere with a future patch, so I'll change it all in a separate commit. Also, replace tabs with spaces for alignment.
2011-06-09Translation updates for 9.1beta2Peter Eisentraut
2011-06-09Pgindent run before 9.1 beta2.Bruce Momjian
2011-05-10For create/dropdb, only connect once to the server since we now have aBruce Momjian
shared description table for pg_database comments. Also update comments about database name selection.
2011-04-10pgindent run before PG 9.1 beta 1.Bruce Momjian
2011-03-05Convert createlang/droplang to use CREATE/DROP EXTENSION.Tom Lane
In createlang this is a one-line change. In droplang there's a whole lot of cruft that can be discarded since the extension mechanism now manages removal of the language's support functions. Also, add deprecation notices to these two programs' reference pages, since per discussion we may toss them overboard altogether in a release or two.
2011-01-01Stamp copyrights for year 2011.Bruce Momjian
2010-11-12Improved parallel make supportPeter Eisentraut
Replace for loops in makefiles with proper dependencies. Parallel make can now span across directories. Also, make -k and make -q work properly. GNU make 3.80 or newer is now required.