Commit Graph

93 Commits

Author SHA1 Message Date
Bruce Momjian d9bc7a3946 Add comments about thousands separator logic. 2007-11-22 15:10:05 +00:00
Bruce Momjian 3894e7cc55 When setting default thousands separator when locale has "", use logic
so new thousands separator doesn't match decimal symbol.
2007-11-21 22:28:18 +00:00
Bruce Momjian 29dccf5fe0 Update CVS HEAD for 2007 copyright. Back branches are typically not
back-stamped for this.
2007-01-05 22:20:05 +00:00
Bruce Momjian f99a569a2e pgindent run for 8.2. 2006-10-04 00:30:14 +00:00
Tom Lane c2f60711d2 Create a FETCH_COUNT parameter that causes psql to execute SELECT-like
queries via a cursor, fetching a limited number of rows at a time and
therefore not risking exhausting memory.  A disadvantage of the scheme
is that 'aligned' output mode will align each group of rows independently
leading to odd-looking output, but all the other output formats work
reasonably well.  Chris Mair, with some additional hacking by moi.
2006-08-29 22:25:08 +00:00
Bruce Momjian e0522505bd Remove 576 references of include files that were not needed. 2006-07-14 14:52:27 +00:00
Tom Lane f3164c0200 Clean up psql's control-C handling to avoid longjmp'ing out of random
places --- that risks corrupting data structures, losing sync with the
backend, etc.  We now longjmp only from calls to readline, fgets, and
fread, which we assume are coded to protect themselves against interrupts
at undesirable times.  This requires adding explicit tests for
cancel_pressed in long-running loops, but on the whole it's far cleaner.
Martijn van Oosterhout and Tom Lane.
2006-06-14 16:49:03 +00:00
Bruce Momjian 399a36a75d Prepare code to be built by MSVC:
o  remove many WIN32_CLIENT_ONLY defines
	o  add WIN32_ONLY_COMPILER define
	o  add 3rd argument to open() for portability
	o  add include/port/win32_msvc directory for
	   system includes

Magnus Hagander
2006-06-07 22:24:46 +00:00
Bruce Momjian f2f5b05655 Update copyright for 2006. Update scripts. 2006-03-05 15:59:11 +00:00
Peter Eisentraut 3228a92ccd ' is not valid HTML 4.01, so print the plain character instead. 2006-02-18 22:54:50 +00:00
Tom Lane 3f9d2edddc Restore previous psql behavior of not printing useless trailing spaces
after the data in the last column on a line.
2006-02-12 02:56:21 +00:00
Tom Lane 9bf2ac2a40 Clean up signedness warnings and 64-bit bugs in recent psql printing
patch.  Martijn van Oosterhout and Tom Lane
2006-02-10 22:29:06 +00:00
Bruce Momjian 1a7be5cc7e Fix psql after newline patch for calloc(0).
Kris Jurka
2006-02-10 15:48:05 +00:00
Bruce Momjian c01999a557 Allow psql multi-line column values to align in the proper columns
If the second output column value is 'a\nb', the 'b' should appear
  in the second display column, rather than the first column as it
  does now.

Change libpq's PQdsplen() to return more useful values.

> Note: this changes the PQdsplen function, it can now return zero or
> minus one which was not possible before. It doesn't appear anyone is
> actually using the functions other than psql but it is a change. The
> functions are not actually documentated anywhere so it's not like we're
> breaking a defined interface. The new semantics follow the Unicode
> standard.

BACKWARD COMPATIBLE CHANGE.

The only user-visible change I saw in the regression tests is that a
SELECT * on a table where all the columns have been dropped doesn't
return a blank line like before.  This seems like a step forward.

Martijn van Oosterhout
2006-02-10 00:39:04 +00:00
Bruce Momjian 3332e38189 Disable expanded mode only for \d tablename, not for all backslash
commands.  Per complaint that \df+ is clearer in expanded mode.
2005-10-27 13:34:47 +00:00
Bruce Momjian 1dc3498251 Standard pgindent run for 8.1. 2005-10-15 02:49:52 +00:00
Peter Eisentraut a8da71e0c4 Clean up some messages and fix missing translation support. Option --log
renamed to --log-file for clarity.
2005-10-04 19:01:18 +00:00
Bruce Momjian 8ddd22f245 Fix incorrect psql \x memory allocation for numericlocale. Redesign API
to be less error-prone.
2005-09-27 16:30:25 +00:00
Bruce Momjian c23240ecbe Rename variable for clarity. 2005-09-26 18:09:57 +00:00
Tom Lane 8889685555 Suppress signed-vs-unsigned-char warnings. 2005-09-24 17:53:28 +00:00
Bruce Momjian d7a06c2ac8 Fix psql \x by removing puts().
Greg Sabino Mullane
2005-09-22 15:51:51 +00:00
Bruce Momjian 507465525e \pset numericsep -> numericlocale. 2005-07-18 20:57:53 +00:00
Bruce Momjian 71d0cabecd Fix len so decimal length is only added when a period appears in the output. 2005-07-18 19:27:37 +00:00
Bruce Momjian adeede1391 Fix numiericsep length computations.
Eugen Nedelcu
2005-07-18 18:58:45 +00:00
Bruce Momjian bd15782164 Enable multi-byte thousands_sep and decimal_point for numericsep. 2005-07-14 21:12:41 +00:00
Bruce Momjian fbc11b9dcf Make better thousands_sep default based on decimal marker value. 2005-07-14 15:54:21 +00:00
Bruce Momjian 45a19efa9e Change numericsep to a boolean, and make it locale-aware. 2005-07-14 08:42:37 +00:00
Bruce Momjian 4a8bbbd2ee Add numeric separator support for latex and troff output methods. 2005-07-14 07:32:01 +00:00
Bruce Momjian 52d1d2e67c barebones variable name -> tuples_only, for consistency. 2005-07-14 06:49:58 +00:00
Bruce Momjian cff9c5748a Fix malloc length for new numeric separator patch.
Centralize malloc into function.
2005-07-14 06:46:17 +00:00
Bruce Momjian f86c63ab6a Reverse pg_malloc patch because psql/print.c is used in scripts files
that don't have pg_malloc.
2005-07-10 15:53:42 +00:00
Bruce Momjian 8c9393c640 Use failure-safe pg_malloc consistently in psql/print.c. 2005-07-10 15:48:14 +00:00
Bruce Momjian 73a7c322c3 Add psql \pset numericsep to allow output numbers like 100,000.0 or
100.000,0.

Eugen Nedelcu
2005-07-10 03:46:13 +00:00
Bruce Momjian 921de09e40 Use ' ' escapes for leading spaces in table values, for use in
EXPLAIN output.

Jean-Paul Argudo
2005-06-14 22:15:57 +00:00
Bruce Momjian 2ee0d5549f Add -L option to psql to log sessions.
Lorne Sunley
2005-06-14 02:57:45 +00:00
Neil Conway 077811605e Per discussion on -hackers, this patch changes psql's "expanded" output
mode to only affect the presentation of normal query results, not the
output of psql slash commands. Documentation updated. I also made
some unrelated minor psql cleanup. Per suggestion from Stuart Cooper.
2005-06-13 06:36:22 +00:00
Bruce Momjian 5c4955981e \(rs should be \\(rs, per Tom. 2005-06-09 18:40:06 +00:00
Bruce Momjian 4a5cda7bba I've created a patch which adds support for troff "-ms" output to
psql.  i.e. "\pset format troff-ms".  The patch also corrects some
problems with the "latex" format, notably defining an extra column in
the output table, and correcting some alignment issues; it also
changes the output to match the border setting as documented in the
manual page and as shown with the "aligned" format.

The troff-ms output is mostly identical to the latex output allowing
for the differences between the two typesetters.

The output should be saved in a file and piped as follows:

  cat file | tbl | troff -T ps -ms > file.ps
or
  tbl file | troff -T ps -ms > file.ps

Because it contains tabs, you'll need to redirect psql output or use
"script", rather than pasting from a terminal window, due to the tabs
which can be replaced with spaces.

Roger Leigh
2005-06-09 15:27:27 +00:00
Bruce Momjian 0542b1e2fe Use _() macro consistently rather than gettext(). Add translation
macros around strings that were missing them.
2005-02-22 04:43:23 +00:00
Bruce Momjian 2daed8c5b3 Update copyrights that were missed. 2005-01-01 05:43:09 +00:00
Peter Eisentraut e9c05281b5 Get rid of perror(), substitute some better phrased error messages.
malloc() doesn't set errno, so most uses were buggy anyway.
2004-11-09 15:57:57 +00:00
Bruce Momjian e1c8b37afb Add new macro as shorthand for MS VC and Borland C++:
+ #if   defined(_MSC_VER) || defined(__BORLANDC__)
+ #define       WIN32_CLIENT_ONLY
+ #endif
2004-09-27 23:24:45 +00:00
Bruce Momjian b6b71b85bc Pgindent run for 8.0. 2004-08-29 05:07:03 +00:00
Bruce Momjian da9a8649d8 Update copyright to 2004. 2004-08-29 04:13:13 +00:00
Bruce Momjian d6e05afc3d I have noticed that the latex format in psql has some bugs:
o "_" is not escaped, and causes TeX to abort, thinking it's a
  subscript outside of maths mode.  Most of my table and field names
  use underscores, so this is a really nasty one.
o The column count is calculated using the contents of opt_align. But
  opt_align has one extra element, and so it's always one too many.  I
  changed it to count the column headings, like all the other output
  formats.  There may be a bug in computing opt_align that this patch
  does not address, but I'm not yet familiar enough with the psql
  source to fix this as well.
o  The line drawing rules for each border setting (0-3) and expanded
  mode didn't always match the documented behaviour and what other
  formats (e.g. aligned) did.  I made it as conformant as possible,
  and also tidied the alignment of the first line of the footer, which
  was incorrectly indented.

Roger Leigh
2004-08-06 18:09:15 +00:00
Neil Conway 256d4639c9 A few cosmetic fixes and code cleanup. 2004-05-23 22:20:10 +00:00
Bruce Momjian a9fad44372 Move find_my_exec() way up into main.c so it is available to the
timezone code and other places.

Remove elog() calls from find_my_exec;  do fprintf(stderr) instead.  We
can then remove the exec.c handling in the makefile because it doesn't
have to be built to suppress elog calls.
2004-05-18 20:18:59 +00:00
Neil Conway 6f046b9d9f Revert the change to print.c, as this breaks src/bin/scripts. The proper
way to fix this is probably implementing safe memory handling functions
once in a static lib and then using that in the various client apps,
but for the moment I've just reverted the change to un-break the tree.
2004-01-24 20:43:26 +00:00
Neil Conway 610d33c194 This patch makes some of the memory manipulation performed by psql a
little more sane. Some parts of the code was using a static function
xmalloc() that did safe memory allocation (where "safe" means "bail
out on OOM"), but most of it was just invoking calloc() or malloc()
directly. Now almost everything invokes xmalloc() or xcalloc().
2004-01-24 19:38:49 +00:00
PostgreSQL Daemon 969685ad44 $Header: -> $PostgreSQL Changes ... 2003-11-29 19:52:15 +00:00