Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-03-23Remove createlang and droplangPeter Eisentraut
They have been deprecated since PostgreSQL 9.1. Reviewed-by: Magnus Hagander <magnus@hagander.net> Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
2017-01-03Update copyright via script for 2017Bruce Momjian
2016-08-08Field conninfo strings throughout src/bin/scripts.Noah Misch
These programs nominally accepted conninfo strings, but they would proceed to use the original dbname parameter as though it were an unadorned database name. This caused "reindexdb dbname=foo" to issue an SQL command that always failed, and other programs printed a conninfo string in error messages that purported to print a database name. Fix both problems by using PQdb() to retrieve actual database names. Continue to print the full conninfo string when reporting a connection failure. It is informative there, and if the database name is the sole problem, the server-side error message will include the name. Beyond those user-visible fixes, this allows a subsequent commit to synthesize and use conninfo strings without that implementation detail leaking into messages. As a side effect, the "vacuuming database" message now appears after, not before, the connection attempt. Back-patch to 9.1 (all supported versions). Reviewed by Michael Paquier and Peter Eisentraut. Security: CVE-2016-5424
2016-03-24Move psql's print.c and mbprint.c into src/fe_utils.Tom Lane
Just turning the crank ...
2016-01-02Update copyright for 2016Bruce Momjian
Backpatch certain files through 9.1
2015-12-23Improve handling of password reuse in src/bin/scripts programs.Tom Lane
This reverts most of commit 83dec5a71 in favor of having connectDatabase() store the possibly-reusable password in a static variable, similar to the coding we've had for a long time in pg_dump's version of that function. To avoid possible problems with unwanted password reuse, make callers specify whether it's reasonable to attempt to re-use the password. This is a wash for cases where re-use isn't needed, but it is far simpler for callers that do want that. Functionally there should be no difference. Even though we're past RC1, it seems like a good idea to back-patch this into 9.5, like the prior commit. Otherwise, if there are any third-party users of connectDatabase(), they'll have to deal with an API change in 9.5 and then another one in 9.6. Michael Paquier
2015-12-02Fix behavior of printTable() and friends with externally-invoked pager.Tom Lane
The formatting modes that depend on knowledge of the terminal window width did not work right when printing a query result that's been fetched in sections (as a result of FETCH_SIZE). ExecQueryUsingCursor() would force use of the pager as soon as there's more than one result section, and then print.c would see an output file pointer that's not stdout and incorrectly conclude that the terminal window width isn't relevant. This has been broken all along for non-expanded "wrapped" output format, and as of 9.5 the issue affects expanded mode as well. The problem also caused "\pset expanded auto" mode to invariably *not* switch to expanded output in a segmented result, which seems to me to be exactly backwards. To fix, we need to pass down an "is_pager" flag to inform the print.c subroutines that some calling level has already replaced stdout with a pager pipe, so they should (a) not do that again and (b) nonetheless honor the window size. (Notably, this makes the first is_pager test in print_aligned_text() not be dead code anymore.) This patch is a bit invasive because there are so many existing calls of printQuery()/printTable(), but fortunately all but a couple can just pass "false" for the added parameter. Back-patch to 9.5 but no further. Given the lack of field complaints, it's not clear that we should change the behavior in stable branches. Also, the API change for printQuery()/printTable() might possibly break third-party code, again something we don't like to do in stable branches. However, it's not quite too late to do this in 9.5, and with the larger scope of the problem there, it seems worth doing.
2015-11-12vacuumdb: don't prompt for passwords over and overAlvaro Herrera
Having the script prompt for passwords over and over was a preexisting problem when it processed multiple databases or when it processed multiple analyze stages, but the parallel mode introduced in commit a179232047 made it worse. Fix the annoyance by keeping a copy of the password used by the first connection that requires one. Since users can (currently) only have a single password, there's no need for more complex arrangements (such as remembering one password per database). Per bug #13741 reported by Eric Brown. Patch authored and cross-reviewed by Haribabu Kommi and Michael Paquier, slightly tweaked by Álvaro Herrera. Discussion: http://www.postgresql.org/message-id/20151027193919.931.54948@wrigleys.postgresql.org Backpatch to 9.5, where parallel vacuumdb was introduced.
2015-01-06Update copyright for 2015Bruce Momjian
Backpatch certain files through 9.0
2014-02-11scripts: 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-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-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-06-17Make 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-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-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-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-09-20Remove cvs keywords from all files.Magnus Hagander
2010-01-02Update copyright for the year 2010.Bruce Momjian
2009-02-26Add a -w/--no-password option that prevents all password prompts to allPeter Eisentraut
programs that have a -W/--password option. In passing, remove the ancient PSQL_ALWAYS_GET_PASSWORDS compile option.
2009-02-25Sort the output of --help mostly alphabetical, make it align better, makePeter Eisentraut
help of pg_dump and pg_dumpall more similar.
2009-01-01Update copyright for 2009.Bruce Momjian
2008-12-11Append major version number and for libraries soname major version numberPeter Eisentraut
to the gettext domain name, to simplify parallel installations. Also, rename set_text_domain() to pg_bindtextdomain(), because that is what it does.
2008-07-14In psql, rename trans_* variables to translate_*, for clarity.Bruce Momjian
2008-01-01Update copyrights in source tree to 2008.Bruce Momjian
2007-12-12Improve the method of localizing column names and other fixed strings inTom Lane
psql's \d commands and other uses of printQuery(). Previously we would pass these strings through gettext() and then send them to the server as literals in the SQL query. But the code was not set up to handle doubling of quotes in the strings, causing failure if a translation attempted to use the wrong kind of quote marks, as indeed is now the case for (at least) the French translation of \dFp. Another hazard was that gettext() would translate to whatever encoding was implied by the client's LC_CTYPE setting, which might be different from the client_encoding setting, which would probably cause the server to reject the query as mis-encoded. The new arrangement is to send the untranslated ASCII strings to the server, and do the translations inside printQuery() after the query results come back. Per report from Guillaume Lelarge and subsequent discussion.
2007-12-11Make documentation of -W options more accurate and uniform.Tom Lane
2007-08-10Fix unintended change of output format for createlang/droplang -l. MissedTom Lane
these uses of printQuery() in FETCH_COUNT patch a year ago :-(. Per report from Tomoaki Sato.
2007-01-05Update CVS HEAD for 2007 copyright. Back branches are typically notBruce Momjian
back-stamped for this.
2006-07-14Remove 576 references of include files that were not needed.Bruce Momjian
2006-05-29Add PQclear() calls, for completeness (exits shortly anyway).Bruce Momjian
2006-03-05Update copyright for 2006. Update scripts.Bruce Momjian
2005-10-15Standard pgindent run for 8.1.Bruce Momjian
2005-09-05Implement a preliminary 'template' facility for procedural languages,Tom Lane
as per my recent proposal. For now the template data is hard-wired in proclang.c --- this should be replaced later by a new shared system catalog, but we don't want to force initdb during 8.1 beta. This change lets us cleanly load existing dump files even if they contain outright wrong information about a PL's support functions, such as a wrong path to the shared library or a missing validator function. Also, we can revert the recent kluges to make pg_dump dump PL support functions that are stored in pg_catalog. While at it, I removed the code in pg_regress that replaced $libdir with a hardcoded path for temporary installations. This is no longer needed given our support for relocatable installations.
2005-08-15Make createlang and droplang proof against weird search_path settingsTom Lane
by forcing search_path to be just pg_catalog.
2005-07-10This patch implements putting language handlers for the optional PLsBruce Momjian
into pg_catalog rather than public, and supports dumping languages whose handlers are found there. This will make it easier to drop the public schema if desired. Unlike the previous patch, the comments have been updated and I have reformatted some code to meet Alvarro's request to stick to 80 cols. (I actually aghree with this - it makes printing the code much nicer). I think I did the right thing w.r.t versions earlier than 7.3, but I have no real way of checking, so that should be checked by someone with more/older knowledge than me ;-) Andrew Dunstan
2005-06-22Add a validator function for plperl. Andrew DunstanTom Lane
2005-06-14Add -L option to psql to log sessions.Bruce Momjian
Lorne Sunley
2004-12-31Tag appropriate files for rc3PostgreSQL Daemon
Also performed an initial run through of upgrading our Copyright date to extend to 2005 ... first run here was very simple ... change everything where: grep 1996-2004 && the word 'Copyright' ... scanned through the generated list with 'less' first, and after, to make sure that I only picked up the right entries ...
2004-08-29Pgindent run for 8.0.Bruce Momjian
2004-08-29Update copyright to 2004.Bruce Momjian
2004-06-03Add PGETC (for pg_service.conf) and PGLOCALE (for locale dir)Bruce Momjian
environment variable processing to libpq. The patch also adds code to our client apps so we set the environment variable directly based on our binary location, unless it is already set. This will allow our applications to emit proper locale messages that are generated in libpq.
2004-06-01Remove init_nls() functions, call set_pglocale() directly.Bruce Momjian
Add locale to pg_ctl.c.
2004-05-25Make the locale location relocatable.Bruce Momjian
Adjust get_*_path functions to be limited to MAXPGPATH.