Commit Graph

111 Commits

Author SHA1 Message Date
Peter Eisentraut 8032d76b5b Gettext plural support
In the backend, I changed only a handful of exemplary or important-looking
instances to make use of the plural support; there is probably more work
there.  For the rest of the source, this should cover all relevant cases.
2009-03-26 22:26:08 +00:00
Bruce Momjian 511db38ace Update copyright for 2009. 2009-01-01 17:24:05 +00:00
Bruce Momjian c9b2591efc In psql, rename trans_* variables to translate_*, for clarity. 2008-07-14 22:00:04 +00:00
Magnus Hagander 06e6573d57 Fix function headers not matching prototype in header file, per
compiler warnings on msvc.
2008-05-21 16:00:10 +00:00
Andrew Dunstan 07d08a8828 Remove old kluge put in to allow Windows regression tests to succeed, and now
found to have been made necessary by our skipping tty detection on Windows. Now
that we are doing tty detection on Windows the kluge is unnecessary and wrong.
2008-05-18 06:50:08 +00:00
Bruce Momjian 265f19d78b Use isatty() test for pager on Win32; not sure why it was disabled for
that platform.
2008-05-17 23:34:44 +00:00
Bruce Momjian e2cd62c3e1 In psql, test for output to stdout when forcing pager for wide output. 2008-05-17 21:40:44 +00:00
Tom Lane 2e27b0e146 Fix utterly-bogus code for computing row heights. Per crashes on
spoonbill, though one wonders why it didn't misbehave everywhere.
In passing remove some unnecessary modulo calculations.
2008-05-17 17:52:14 +00:00
Tom Lane e7b498bd5e Recent patch doesn't compile without <limits.h> 2008-05-16 18:35:38 +00:00
Bruce Momjian 43ee22826b Add detection of psql pager to trigger on wide output. Also add pager
detection for wrapped lines or lines with newlines that need pager to
display.
2008-05-16 16:59:05 +00:00
Alvaro Herrera e6a64bd3b6 Fix a bug in the previous patch, which caused the title pointer to be used
before it was actually set.
2008-05-13 00:14:11 +00:00
Alvaro Herrera 1e9199e84c Improve psql's internal print.c code by introducing an actual print API.
Provides for better code readability, but mainly this is infrastructure changes
to allow further changes such as arbitrary footers on printed tables.  Also,
the translation status of each element in the table is more easily customized.

Brendan Jurd, with some editorialization by me.
2008-05-12 22:59:58 +00:00
Tom Lane 125ed6853e Restore psql's former behavior that padding spaces to the right of the last
output column are not emitted.  (That change already caused more noise in
the regression test output files than I would like.)  Provide some needed
editorial help for comments, clean up code formatting.
2008-05-10 03:31:58 +00:00
Bruce Momjian 5adf98ae24 Add psql '\pset format wrapped' mode to wrap output to screen width, or
file/pipe output too if \pset columns' is set.

Bryce Nesbitt
2008-05-08 17:04:26 +00:00
Tom Lane 039dfbfd5d Reduce the need for frontend programs to include "postgres.h" by refactoring
inclusions in src/include/catalog/*.h files.  The main idea here is to push
function declarations for src/backend/catalog/*.c files into separate headers,
rather than sticking them into the corresponding catalog definition file as
has been done in the past.  This commit only carries out that idea fully for
pg_proc, pg_type and pg_conversion, but that's enough for the moment ---
if pg_list.h ever becomes unsafe for frontend code to include, we'll need
to work a bit more.

Zdenek Kotala
2008-03-27 03:57:34 +00:00
Bruce Momjian 9098ab9e32 Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
Tom Lane df4271fedd Improve the method of localizing column names and other fixed strings in
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-12 21:41:47 +00:00
Bruce Momjian b85cf684f7 Add more comments about thousands separator handling. 2007-11-22 17:51:39 +00:00
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 &apos; 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