Commit Graph

21 Commits

Author SHA1 Message Date
Bruce Momjian ea72cc4e11 Attached ia a patch to enable window size detection code of psql for Solaris
platform.

TIOCGWINSZ is defined as follows:

    Linux       asm/ioctls.h
    FreeBSD     sys/ttycom.h. This file is included by sys/ioctl.h.
    Solaris     sys/termios.h

This patch tells print.c to know TIOCGWINSZ on Solaris platform. Same code is
founded in src/bin/psal/common.c.

Kenji Sugita
2001-08-01 18:44:54 +00:00
Peter Eisentraut e542036461 Native Language Support (NLS)
Use --enable-nls to turn it on; see installation instructions for details.
See developer's guide how to make use of it in programs and how to add
translations.

psql sources have been almost fully prepared and an incomplete German
translation has been provided.  In the backend, only elog() calls are
currently translatable, and the provided German translation file is more
of a placeholder.
2001-06-02 18:25:18 +00:00
Peter Eisentraut b3f66d1980 Add command '\pset footer' to psql to turn off default "(x rows)" footer. 2001-05-12 19:44:46 +00:00
Bruce Momjian 9e1552607a pgindent run. Make it all clean. 2001-03-22 04:01:46 +00:00
Peter Eisentraut 653cd3e38e Fix memory leak. 2001-03-01 18:52:50 +00:00
Tatsuo Ishii df247b821d Massive commits for SunOS4 port. 2001-02-27 08:13:31 +00:00
Tom Lane d08741eab5 Restructure the key include files per recent pghackers discussion: there
are now separate files "postgres.h" and "postgres_fe.h", which are meant
to be the primary include files for backend .c files and frontend .c files
respectively.  By default, only include files meant for frontend use are
installed into the installation include directory.  There is a new make
target 'make install-all-headers' that adds the whole content of the
src/include tree to the installed fileset, for use by people who want to
develop server-side code without keeping the complete source tree on hand.
Cleaned up a whole lot of crufty and inconsistent header inclusions.
2001-02-10 02:31:31 +00:00
Bruce Momjian 312063c97b Make pgsql compile on FreeBSD-alpha.
Context diff this time.

Remove -m486 compile args for FreeBSD-i386, compile -O2 on i386.

Compile with only -O on alpha for codegen safety.

Make the port use the TEST_AND_SET for alpha and i386 on FreeBSD.

Fix a lot of bogus string formats for outputting pointers (cast to int
and %u/%x replaced with no cast and %p), and 'Size'(size_t) are now
cast to 'unsigned long' and output with %lu/

Remove an unused variable.

Alfred Perlstein
2000-11-16 05:51:07 +00:00
Bruce Momjian 52f77df613 Ye-old pgindent run. Same 4-space tabs. 2000-04-12 17:17:23 +00:00
Bruce Momjian 78693c89d7 Clean up include files use in psql. 2000-02-16 13:15:26 +00:00
Bruce Momjian ecd8537376 I checked the WinNT port yesterday (a few days old snapshot from CVS) and I
am including a patch to get it compile.

changes to psql:
- added less as default pager when compiling on Cygwin
- need to declare "filename_completion_function" because it is not exported
from readline -> added to include/port/win.h

changes to pg_id:
- include of <getopt.h>
- add .exe when installing

I think there is a problem with calling the regress tests on WinNT - it
should be called with PORTNAME not HOST as the parameter to regress.sh or
the check  when to add "-h localhost" to psql has to be changed. Now it is
checked against the PORTNAME.

The results of the regress tests were OK with expected failures ;-)

Daniel Horak
2000-02-09 16:23:44 +00:00
Peter Eisentraut 9ceb5d8a7b Fixed psql double quoting of SQL ids
Fixed libpq printing functions
2000-02-07 23:10:11 +00:00
Peter Eisentraut 2b84cbb60f A few minor psql enhancements
Initdb help correction
Changed end/abort to commit/rollback and changed related notices
Commented out way old printing functions in libpq
Fixed a typo in alter table / alter column
2000-01-29 16:58:54 +00:00
Peter Eisentraut f565cf41ab another set of cleanups 2000-01-18 23:30:24 +00:00
Bruce Momjian 0cb6bc70ce Hi!
Here is a patch to bring both libpq and psql to a state where it compiles on
win32 (native) again. A lot of things have changed, and I have not been able
to keep up with them all, so it has been broken for quite a while.
After this patch, at least it compiles. It also talks "basic talk" to the
server, but I have not yet tested all things. Sending queries, and using
e.g. \d or \dt works fine. The rest will have to be tested further.
It also bumps the version on libpq.dll to 7.0.

Everything should be enclosed in #ifdef WIN32, unless I have missed
something. Except for one or maybe two places where I have moved a #include
that should not be used on win32 from the "global area" into a "#ifndef
WIN32 area".


//Magnus
2000-01-18 19:05:31 +00:00
Peter Eisentraut f6689a328f Fixed a few "fixes" and bugs. Adjusted messages and options to GNU suggestions. 2000-01-12 19:36:36 +00:00
Bruce Momjian 77a4729936 This should fix the \e (\p, \g, ...) behaviour on an empty query buffer.
Also, minor tweakage of tab completion, and I hope the output is flushed
on time now.

--
Peter Eisentraut                  Sernanders väg 10:115
1999-12-10 03:59:30 +00:00
Bruce Momjian 78bc83fedf * Includes tab completion. It's not magic, but it's very cool. At any
rate
  it's better than what used to be there.

* Does proper SQL "host variable" substitution as pointed out by Andreas
  Zeugwetter (thanks): select * from :foo; Also some changes in how ':'
  and ';' are treated (escape with \ to send to backend). This does
_not_
  affect the '::' cast operator, but perhaps others that contain : or ;
  (but there are none right now).

* To show description with a <something> listing, append '?' to command
  name, e.g., \df?. This seemed to be the convenient and logical
solution.
  Or append a '+' to see more useless information, e.g., \df+.

* Fixed fflush()'ing bug pointed out by Jan during the regression test
  discussion.

* Added LastOid variable. This ought to take care of TODO item "Add a
  function to return the last inserted oid, for use in psql scripts"
  (under CLIENTS)
  E.g.,
insert into foo values(...);
insert into bar values(..., :LastOid);
\echo $LastOid

* \d command shows constraints, rules, and triggers defined on the table
  (in addition to indices)

* Various fixes, optimizations, corrections

* Documentation update as well


Note: This now requires snprintf(), which, if necessary, is taken from
src/backend/port. This is certainly a little weird, but it should
suffice
until a source tree cleanup is done.

Enjoy.

--
Peter Eisentraut                  Sernanders väg 10:115
1999-11-26 04:24:17 +00:00
Bruce Momjian 2a24ec6f16 In the spirit of TODO item
* Add use of 'const' for varibles in source tree
(which is misspelled, btw.)
I went through the front-end libpq code and did so. This affects in
particular the various accessor functions (such as PQdb() and
PQgetvalue()) as well as, by necessity, the internal helpers they use.

I have been really thorough in that regard, perhaps some people will find
it annoying that things like
char * foo = PQgetvalue(res, 0, 0)
will generate a warning. On the other hand it _should_ generate one. This
is no real compatibility break, although a few clients will have to be
fixed to suppress warnings. (Which again would be in the spirit of the
above TODO.)

In addition I replaced some int's by size_t's and removed some warnings
(and generated some new ones -- grmpf!). Also I rewrote PQoidStatus (so it
actually honors the const!) and supplied a new function PQoidValue that
returns a proper Oid type. This is only front-end stuff, none of the
communicaton stuff was touched.


The psql patch also adds some new consts to honor the new libpq situation,
as well as fixes a fatal condition that resulted when using the -V
(--version) option and there is no database listening.


So, to summarize, the psql you should definitely put in (with or without
the libpq). If you think I went too far with the const-mania in libpq, let
me know and I'll make adjustments. If you approve it, I will also update
the docs.

        -Peter

--
Peter Eisentraut                  Sernanders vaeg 10:115
1999-11-11 00:10:14 +00:00
Bruce Momjian 0e6652e673 psql cleanup 1999-11-04 23:14:30 +00:00
Bruce Momjian a45195a191 Major psql overhaul by Peter Eisentraut. 1999-11-04 21:56:02 +00:00