aboutsummaryrefslogtreecommitdiff
path: root/src/bin/scripts/common.h
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.
* Update copyrights for 2013Bruce Momjian2013-01-01
| | | | | Fully update git head, and update back branches in ./COPYRIGHT and legal.sgml files.
* Standardize naming of malloc/realloc/strdup wrapper functions.Tom Lane2012-10-02
| | | | | | | | | | | | 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.)
* Run pgindent on 9.2 source tree in preparation for first 9.3Bruce Momjian2012-06-10
| | | | commit-fest.
* Update copyright notices for year 2012.Bruce Momjian2012-01-01
|
* Make command-line tools smarter about finding a DB to connect to.Robert Haas2011-12-06
| | | | | | | | 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.
* Add markers.Bruce Momjian2011-08-26
|
* Stamp copyrights for year 2011.Bruce Momjian2011-01-01
|
* Remove cvs keywords from all files.Magnus Hagander2010-09-20
|
* Update copyright for the year 2010.Bruce Momjian2010-01-02
|
* Remove a boatload of useless definitions of 'int optreset'. If weTom Lane2009-04-05
| | | | | | are using our own ports of getopt or getopt_long, those will define the variable for themselves; and if not, we don't need these, because we never touch the variable anyway.
* Add a -w/--no-password option that prevents all password prompts to allPeter Eisentraut2009-02-26
| | | | | | programs that have a -W/--password option. In passing, remove the ancient PSQL_ALWAYS_GET_PASSWORDS compile option.
* Update copyright for 2009.Bruce Momjian2009-01-01
|
* Fix a few warnings that have crept into CVS HEAD.Bruce Momjian2008-05-14
|
* Update copyrights in source tree to 2008.Bruce Momjian2008-01-01
|
* pgindent run for 8.3.Bruce Momjian2007-11-15
|
* Add cancel handlers so it's possible to Ctrl-C clusterdb, reindexdbMagnus Hagander2007-04-09
| | | | | and vacuumdb. ITAGAKI Takahiro, with minor fixes from me.
* Update CVS HEAD for 2007 copyright. Back branches are typically notBruce Momjian2007-01-05
| | | | back-stamped for this.
* Rearrange yes/no prompting code so that the prompts always show thePeter Eisentraut2006-09-22
| | | | | | | (possibly (un)translated) letters that are actually expected as input. Also reject invalid responses instead of silenty taken them as "no". with help from Bernd Helmle
* Remove 576 references of include files that were not needed.Bruce Momjian2006-07-14
|
* Update copyright for 2006. Update scripts.Bruce Momjian2006-03-05
|
* Standard pgindent run for 8.1.Bruce Momjian2005-10-15
|
* Make createlang and droplang proof against weird search_path settingsTom Lane2005-08-15
| | | | by forcing search_path to be just pg_catalog.
* Use _() macro consistently rather than gettext(). Add translationBruce Momjian2005-02-22
| | | | macros around strings that were missing them.
* Fix HAVE_OPTRESET to be HAVE_INT_OPTRESET. Typos spotted by Lorne Sunley.Tom Lane2004-11-27
|
* Remove init_nls() functions, call set_pglocale() directly.Bruce Momjian2004-06-01
| | | | Add locale to pg_ctl.c.
* Make the locale location relocatable.Bruce Momjian2004-05-25
| | | | Adjust get_*_path functions to be limited to MAXPGPATH.
* Move simple_prompt()/sprompt.c into /port.Bruce Momjian2003-08-08
|
* Don't assume that struct option is available just because we can find aTom Lane2003-08-07
| | | | | | | getopt_long(). This is more or less the same problem as we saw earlier with getaddrinfo() and struct addrinfo, and for the same reason: random user-added libraries might contain the subroutine, but there's no guarantee we will find the matching header files.
* pgindent run.Bruce Momjian2003-08-04
|
* Internationalize interactive yes/no responses.Peter Eisentraut2003-05-27
|
* Add Win32 path handling for / vs. \ and drive letters.Bruce Momjian2003-04-04
|
* Reimplement create and drop scripts in C, to reduce repetitivePeter Eisentraut2003-03-18
connections, increase robustness, add NLS, and prepare for Windows port. (vacuumdb and clusterdb will follow later.)