aboutsummaryrefslogtreecommitdiff
path: root/src/bin/scripts/createlang.c
Commit message (Collapse)AuthorAge
* Remove createlang and droplangPeter Eisentraut2017-03-23
| | | | | | | They have been deprecated since PostgreSQL 9.1. Reviewed-by: Magnus Hagander <magnus@hagander.net> Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
* Update copyright via script for 2017Bruce Momjian2017-01-03
|
* Field conninfo strings throughout src/bin/scripts.Noah Misch2016-08-08
| | | | | | | | | | | | | | | | | | | | | 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
* Move psql's print.c and mbprint.c into src/fe_utils.Tom Lane2016-03-24
| | | | Just turning the crank ...
* Update copyright for 2016Bruce Momjian2016-01-02
| | | | Backpatch certain files through 9.1
* Improve handling of password reuse in src/bin/scripts programs.Tom Lane2015-12-23
| | | | | | | | | | | | | | | | | 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
* Fix behavior of printTable() and friends with externally-invoked pager.Tom Lane2015-12-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* vacuumdb: don't prompt for passwords over and overAlvaro Herrera2015-11-12
| | | | | | | | | | | | | | | | | | | 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.
* Update copyright for 2015Bruce Momjian2015-01-06
| | | | Backpatch certain files through 9.0
* scripts: Remove newlines from end of generated SQLPeter Eisentraut2014-02-10
| | | | | | | | | 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>
* Update copyright for 2014Bruce Momjian2014-01-07
| | | | | Update all files in head, and files COPYRIGHT and legal.sgml in all back branches.
* Fix translatability markings in psql, and add defenses against future bugs.Tom Lane2014-01-04
| | | | | | | | | | | | | | | | | | | | | | 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
* Fix incorrect error message reported for non-existent usersBruce Momjian2013-12-18
| | | | | | | | 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
* Update copyrights for 2013Bruce Momjian2013-01-01
| | | | | Fully update git head, and update back branches in ./COPYRIGHT and legal.sgml files.
* In our source code, make a copy of getopt's 'optarg' string arguments,Bruce Momjian2012-10-12
| | | | rather than just storing a pointer.
* Make documentation of --help and --version options more consistentPeter Eisentraut2012-06-18
| | | | | | 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.
* Run pgindent on 9.2 source tree in preparation for first 9.3Bruce Momjian2012-06-10
| | | | commit-fest.
* Don't override arguments set via options with positional arguments.Andrew Dunstan2012-04-17
| | | | | | | | | 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.
* 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.
* Remove double-quoting of table names in clusterdb. BACKWARD COMPABILITYBruce Momjian2011-09-10
| | | | | | | | | | 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.
* Convert createlang/droplang to use CREATE/DROP EXTENSION.Tom Lane2011-03-05
| | | | | | | | | | 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.
* 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
|
* 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.
* Sort the output of --help mostly alphabetical, make it align better, makePeter Eisentraut2009-02-25
| | | | help of pg_dump and pg_dumpall more similar.
* Update copyright for 2009.Bruce Momjian2009-01-01
|
* Append major version number and for libraries soname major version numberPeter Eisentraut2008-12-11
| | | | | | | to the gettext domain name, to simplify parallel installations. Also, rename set_text_domain() to pg_bindtextdomain(), because that is what it does.
* In psql, rename trans_* variables to translate_*, for clarity.Bruce Momjian2008-07-14
|
* Update copyrights in source tree to 2008.Bruce Momjian2008-01-01
|
* Improve the method of localizing column names and other fixed strings inTom Lane2007-12-12
| | | | | | | | | | | | | | | 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.
* Make documentation of -W options more accurate and uniform.Tom Lane2007-12-11
|
* Fix unintended change of output format for createlang/droplang -l. MissedTom Lane2007-08-10
| | | | | these uses of printQuery() in FETCH_COUNT patch a year ago :-(. Per report from Tomoaki Sato.
* Update CVS HEAD for 2007 copyright. Back branches are typically notBruce Momjian2007-01-05
| | | | back-stamped for this.
* Remove 576 references of include files that were not needed.Bruce Momjian2006-07-14
|
* Add PQclear() calls, for completeness (exits shortly anyway).Bruce Momjian2006-05-29
|
* Update copyright for 2006. Update scripts.Bruce Momjian2006-03-05
|
* Standard pgindent run for 8.1.Bruce Momjian2005-10-15
|
* Implement a preliminary 'template' facility for procedural languages,Tom Lane2005-09-05
| | | | | | | | | | | | | | 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.
* Make createlang and droplang proof against weird search_path settingsTom Lane2005-08-15
| | | | by forcing search_path to be just pg_catalog.
* This patch implements putting language handlers for the optional PLsBruce Momjian2005-07-10
| | | | | | | | | | | | | | | | 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
* Add a validator function for plperl. Andrew DunstanTom Lane2005-06-22
|
* Add -L option to psql to log sessions.Bruce Momjian2005-06-14
| | | | Lorne Sunley
* Tag appropriate files for rc3PostgreSQL Daemon2004-12-31
| | | | | | | | 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 ...
* Pgindent run for 8.0.Bruce Momjian2004-08-29
|
* Update copyright to 2004.Bruce Momjian2004-08-29
|
* Add PGETC (for pg_service.conf) and PGLOCALE (for locale dir)Bruce Momjian2004-06-03
| | | | | | | | | 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.
* 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.