- Jul 10, 2014
-
-
Fujii Masao authored
When the psql variable ECHO is set to 'erros', only failed SQL commands are printed to standard error output. Also this patch adds -b option into psql. This is equivalent to setting the variable ECHO to 'errors'. Pavel Stehule, reviewed by Fabrízio de Royes Mello, Samrat Revagade, Kumar Rajeev Rastogi, Abhijit Menon-Sen, and me.
-
- Mar 10, 2014
-
-
Tom Lane authored
Commit 08146775 changed do_copy() to temporarily scribble on pset.cur_cmd_source. That was a mighty ugly bit of code in any case, but in particular it broke handleCopyIn's ability to tell whether it was reading from the current script source file (in which case pset.lineno should be incremented for each line of COPY data), or from someplace else (in which case it shouldn't). The former case still worked, the latter not so much. The visible effect was that line numbers reported for errors in a script file would be wrong if there were an earlier \copy that was reading anything other than inline-in-the-script-file data. To fix, introduce another pset field that holds the file do_copy wants the COPY code to use. This is a little bit ugly, but less so than passing the file down explicitly through several layers that aren't COPY-specific. Extracted from a larger patch by Kumar Rajeev Rastogi; that patch also changes printing of COPY command tags, which is not a bug fix and shouldn't get back-patched. This particular idea was from a suggestion by Amit Khandekar, if I'm reading the thread correctly. Back-patch to 9.2 where the faulty code was introduced.
-
- Mar 02, 2014
-
-
Stephen Frost authored
A number of issues were identified by the Coverity scanner and are addressed in this patch. None of these appear to be security issues and many are mostly cosmetic changes. Short comments for each of the changes follows. Correct the semi-colon placement in be-secure.c regarding SSL retries. Remove a useless comparison-to-NULL in proc.c (value is dereferenced prior to this check and therefore can't be NULL). Add checking of chmod() return values to initdb. Fix a couple minor memory leaks in initdb. Fix memory leak in pg_ctl- involves free'ing the config file contents. Use an int to capture fgetc() return instead of an enum in pg_dump. Fix minor memory leaks in pg_dump. (note minor change to convertOperatorReference()'s API) Check fclose()/remove() return codes in psql. Check fstat(), find_my_exec() return codes in psql. Various ECPG memory leak fixes. Check find_my_exec() return in ECPG. Explicitly ignore pqFlush return in libpq error-path. Change PQfnumber() to avoid doing an strdup() when no changes required. Remove a few useless check-against-NULL's (value deref'd beforehand). Check rmtree(), malloc() results in pg_regress. Also check get_alternative_expectfile() return in pg_regress.
-
- Feb 15, 2014
-
-
Tom Lane authored
We used to have externs for getopt() and its API variables scattered all over the place. Now that we find we're going to need to tweak the variable declarations for Cygwin, it seems like a good idea to have just one place to tweak. In this commit, the variables are declared "#ifndef HAVE_GETOPT_H". That may or may not work everywhere, but we'll soon find out. Andres Freund
-
- Jan 07, 2014
-
-
Bruce Momjian authored
Update all files in head, and files COPYRIGHT and legal.sgml in all back branches.
-
- Oct 23, 2013
-
-
Tom Lane authored
This eliminates an awkward coding pattern that's also unnecessarily inconsistent with backend coding. psprintf() is now the thing to use everywhere.
-
- Oct 13, 2013
-
-
Peter Eisentraut authored
Add asprintf(), pg_asprintf(), and psprintf() to simplify string allocation and composition. Replacement implementations taken from NetBSD. Reviewed-by:
Álvaro Herrera <alvherre@2ndquadrant.com> Reviewed-by:
Asif Naeem <anaeem.it@gmail.com>
-
- Oct 03, 2013
-
-
Peter Eisentraut authored
The cancel handler was uselessly set up even before the first connection was opened. By setting it up afterwards, the user can use Ctrl+C to abort psql if the initial connection attempt hangs. Reviewed-by:
Dean Rasheed <dean.a.rasheed@gmail.com> Reviewed-by:
Ryan Kelly <rpkelly22@gmail.com>
-
- Jul 01, 2013
-
-
Bruce Momjian authored
The -h option was not supported by many tools, and not documented, so remove them for consistency from pg_upgrade, pg_test_fsync, and pg_test_timing.
-
- Jun 18, 2013
-
-
Peter Eisentraut authored
-
- May 29, 2013
-
-
Bruce Momjian authored
This is the first run of the Perl-based pgindent script. Also update pgindent instructions.
-
- Apr 04, 2013
-
-
Bruce Momjian authored
'strdup' the PSQLRC environment variable value before calling a routine that might free() it. Backpatch to 9.2, where the bug first appeared.
-
- Mar 04, 2013
-
-
Peter Eisentraut authored
reviewed by Satoshi Nagayasu
-
- Jan 01, 2013
-
-
Bruce Momjian authored
Fully update git head, and update back branches in ./COPYRIGHT and legal.sgml files.
-
- Oct 12, 2012
-
-
Bruce Momjian authored
rather than just storing a pointer.
-
- Oct 02, 2012
-
-
Tom Lane authored
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.)
-
- Aug 09, 2012
-
-
Robert Haas authored
Previously, the -1 option was silently ignored. Also, emit an error if -1 is used in a context where it won't be respected, to avoid user confusion. Original patch by Fabien COELHO, but this version is quite different from the original submission.
-
- Jun 10, 2012
-
-
Bruce Momjian authored
commit-fest.
-
- May 27, 2012
-
-
Peter Eisentraut authored
This was from a time when readline support wasn't standard. And it doesn't help analyzing current line editing library problems.
-
- May 01, 2012
-
-
Robert Haas authored
Noah Misch
-
- Mar 03, 2012
-
-
Andrew Dunstan authored
PSQL_HISTORY provides an alternative for the command history file, and PSQLRC provides an alternative location for the .psqlrc file.
-
- Mar 01, 2012
-
-
Peter Eisentraut authored
Running "psql -f -" used to print psql:<stdin>:1: ERROR: blah but that got broken between 8.4 and 9.0 (commit b291c0fb), and now it printed psql:-:1: ERROR: blah This reverts to the old behavior and cleans up some code that was left dead or useless by the mentioned commit.
-
- Feb 09, 2012
-
-
Peter Eisentraut authored
Add new psql settings and command-line options to support setting the field and record separators for unaligned output to a zero byte, for easier interfacing with other shell tools. reviewed by Abhijit Menon-Sen
-
- Jan 02, 2012
-
-
Bruce Momjian authored
-
- Oct 15, 2011
-
-
Bruce Momjian authored
matching version file does not exist. This avoids needing to rename .psqlrc files after minor version upgrades.
-
- Jul 06, 2011
-
-
Robert Haas authored
\ir is short for "include relative"; when used from a script, the supplied pathname will be interpreted relative to the input file, rather than to the current working directory. Gurjeet Singh, reviewed by Josh Kupershmidt, with substantial further cleanup by me.
-
- Feb 19, 2011
-
-
Peter Eisentraut authored
Add a new libpq connection option client_encoding (which includes the existing PGCLIENTENCODING environment variable), which besides an encoding name accepts a special value "auto" that tries to determine the encoding from the locale in the client's environment, using the mechanisms that have been in use in initdb. psql sets this new connection option to "auto" when running from a terminal and not overridden by setting PGCLIENTENCODING. original code by Heikki Linnakangas, with subsequent contributions by Jaime Casanova, Peter Eisentraut, Stephen Frost, Ibrar Ahmed
-
- Feb 16, 2011
-
-
Peter Eisentraut authored
This was previously not very useful, but with many people customizing the linestyle, it is nice for a consistent appearance.
-
- Jan 01, 2011
-
-
Bruce Momjian authored
-
- Sep 20, 2010
-
-
Magnus Hagander authored
-
- Mar 07, 2010
-
-
Magnus Hagander authored
-
- Mar 06, 2010
-
-
Magnus Hagander authored
file instead of ~/.psqlrc on startup.
-
- Feb 26, 2010
-
-
Bruce Momjian authored
-
- Feb 16, 2010
-
-
Bruce Momjian authored
versions match, per report from Peter.
-
- Feb 05, 2010
-
-
Joe Conway authored
If expand_dbname is non-zero and dbname contains an = sign, it is taken as a conninfo string in exactly the same way as if it had been passed to PQconnectdb. This is equivalent to the way PQsetdbLogin() works, allowing PQconnectdbParams() to be a complete alternative. Also improve the way the new function is called from psql and replace a previously missed call to PQsetdbLogin() in psql. Additionally use PQconnectdbParams() for pg_dump and friends, and the bin/scripts command line utilities such as vacuumdb, createdb, etc. Finally, update the documentation for the new parameter, as well as the nuances of precedence in cases where key words are repeated or duplicated in the conninfo string.
-
- Jan 28, 2010
-
-
Joe Conway authored
PQconnectStartParams. These are analogous to PQconnectdb and PQconnectStart respectively. They differ from the legacy functions in that they accept two NULL-terminated arrays, keywords and values, rather than conninfo strings. This avoids the need to build the conninfo string in cases where it might be inconvenient to do so. Includes documentation. Also modify psql to utilize PQconnectdbParams rather than PQsetdbLogin. This allows the new config parameter application_name to be set, which in turn is displayed in the pg_stat_activity view and included in CSV log entries. This will also ensure both new functions get regularly exercised. Patch by Guillaume Lelarge with review and minor adjustments by Joe Conway.
-
- Jan 02, 2010
-
-
Bruce Momjian authored
-
- Dec 01, 2009
-
-
Bruce Momjian authored
Adjust psql -f - to behave like a normal file and honor the -1 flag. Report from Robert Haas
-
- Apr 05, 2009
-
-
Tom Lane authored
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.
-
- Feb 26, 2009
-
-
Peter Eisentraut authored
programs that have a -W/--password option. In passing, remove the ancient PSQL_ALWAYS_GET_PASSWORDS compile option.
-