Commit Graph

106 Commits

Author SHA1 Message Date
Marc G. Fournier ef56e51cd3 - Renamed the variable names to something shorter, and I hope
nicer. Also, I grabbed my copy of the Informix manual, and
    added a couple of variables that make sense (formats for
    money, time, a language setting, a timezone).

  - New functions SetPGVariable() and GetPGVariable() in tcop/*.
    These don't actually do anything for the moment, but should
    be enough to implement the SET var_name TO var_val in the
    parser?

    SetPGVariable() expects just two strings, the var_name and
    the var_value from above, and is expected to do the right thing.
    Returns TRUE if  everything okay.


From: "Martin J. Laubach" <mjl@wwx.vip.at>
1997-03-25 02:37:21 +00:00
Marc G. Fournier 812a6c2b54 - Move most of the I/O in both libpq and the backend to a set
of common routines in pqcomprim.c (pq communication primitives).
    Not all adapted to it yet, but it's a start.

  - Rewritten some of those routines, to write/read bigger chunks of
    data, precomputing stuff in buffers instead of sending out byte
    by byte.

  - As a consequence, I need to know the endianness of the machine.
    Currently I rely on getting it from machine/endian.h, but this
    may not be available everywhere? (Who the hell thought it was
    a good idea to pass integers to the backend the other way around
    than the normal network byte order? *argl*)

  - Libpq looks in the environment for magic variables, and upon
    establishing a connection to the backend, sends it queries
    of the form "SET var_name TO 'var_value'". This needs a change
    in the backend parser (Mr. Parser, are you there? :)

  - Currently it looks for two Env-Vars, namely PG_DATEFORMAT
    and PG_FLOATFORMAT. What else makes sense? PG_TIMEFORMAT?
    PG_TIMEZONE?

From: "Martin J. Laubach" <mjl@wwx.vip.at>
1997-03-18 20:15:39 +00:00
Marc G. Fournier 7d02575ad1 Fixes for libpgtcl from Massimo 1997-03-17 22:05:08 +00:00
Marc G. Fournier 5ea01d62ef Don't forget the fe-connect.h include file 1997-03-16 19:06:04 +00:00
Marc G. Fournier 7cd394dc43 From: Thomas Lockhart <Thomas.G.Lockhart@jpl.nasa.gov>
Subject: [HACKERS] Patches for 970316 compilation

I made a small pre-emptive change in the new datetime code to eliminate
calls to infnan(). Hopefully this will make Solaris (and probably other
non-GNUlib) systems happier. Didn't find fe-connect.h in the 970316
distribution, so made one up. Also, one of the test routines needs an
update for the geo-decls.h -> geo_decls.h name change.
Patches appear below...
1997-03-16 19:05:00 +00:00
Marc G. Fournier ea58f28ee8 om: "Martin J. Laubach" <mjl@CSlab.tuwien.ac.at>
Subject: [HACKERS] Patch for io routines

  I am currently trying to improve on the front-backend communication
routines; and noticed that lots of code are duplicated for libpq and
the backend. This is a first patch that tries to share code between
the two, more to follow.

        mjl
1997-03-16 18:51:29 +00:00
Marc G. Fournier 3031ec7c72 NetBSD Shared Library Patch from Martin J. Laubach 1997-03-15 19:17:03 +00:00
Marc G. Fournier 791c075852 Date/Time updates from Thomas... 1997-03-14 23:34:16 +00:00
Marc G. Fournier 3a7c93e7f3 From: Dan McGuirk <mcguirk@indirect.com>
Subject: [HACKERS] password authentication

This patch adds support for plaintext password authentication.  To use
it, you add a line like

host         all         0.0.0.0       0.0.0.0           password  pg_pwd.conf


to your pg_hba.conf, where 'pg_pwd.conf' is the name of a file containing
the usernames and password hashes in the format of the first two fields
of a Unix /etc/passwd file.  (Of course, you can use a specific database
name or IP instead.)

Then, to connect with a password through libpq, you use the PQconnectdb()
function, specifying the "password=" tag in the connect string and also
adding the tag "authtype=password".

I also added a command-line switch '-u' to psql that tells it to prompt
for a username and password and use password authentication.
1997-03-12 21:23:16 +00:00
Marc G. Fournier eacd0fd938 Bring in Leo's <lsh@lubrizol.com> massive changes to libpq++ 1997-02-13 10:01:05 +00:00
Marc G. Fournier a5494a2d92 Various patches for nextstep by GregorHoffleit
Replaced NEED_STRDUP by !HAVE_STRDUP
1997-02-13 08:32:20 +00:00
Marc G. Fournier cfe18a8e3f Remove from include/config.h:
#if defined(aix)
#define TERMIOS_H_LOCATION <termios.h>
#else
#define TERMIOS_H_LOCATION <sys/termios.h>
#endif

libpq/fe-exec.c modified so that location of termios.h is determined
by whether HAVE_TERMIOS_H is defined or not, in preparation for switch
to configure
1997-01-24 17:47:39 +00:00
Marc G. Fournier fdaf47f9f4 The last patch fixes some incongruences in the #define used to compile the
Tcl arrays support. Here are the correct values to be defined in config.h
and pgtclCmds.c.

Submitted by: Massimo Dal Zotto <dz@cs.unitn.it>
1997-01-23 19:47:18 +00:00
Marc G. Fournier f0ff9ac0c2 Fix from Andrew for compiling libpgtcl...basically, switch off -Werror,
which probably isn't needed, since we are going to take off -Werror
anyway, right?
1997-01-23 16:04:25 +00:00
Bryan Henderson 52052f3a19 Use gcc to make Linux ELF shared library, instead of ld. 1997-01-20 00:51:38 +00:00
Marc G. Fournier e2e6b2d730 Fixes:
I forgot to clear out the variable created and the memory used.

From: darcy@druid.net (D'Arcy J.M. Cain)
1997-01-11 14:28:51 +00:00
Marc G. Fournier 8738e47d03 From: darcy@druid.net (D'Arcy J.M. Cain)
Fix for libpgtcl:

I forgot to clear out the variable created and the memory used.
1997-01-11 14:24:40 +00:00
Bruce Momjian 63b22d8aa9 cleanup for LINUX_ELF 1997-01-10 18:55:24 +00:00
Bruce Momjian 90ff767d14 I found the following bugs in the version 6.0 (dated 961229).
At least the first two should be fixed before the final release of 6.0.

1)      There is a mismatch between the type declared in the catalog for
        the input/output attributes of pg_type and the actual type of
        values stored in the table.  The type of typinput, typoutput,
        typsend and typreceive are declared oid (26) while the values are
        regproc (24).  The error was there also in previous versions but
        nobody noticed it until an Assert has been added in ExecEvalVar.
        The effect is that it is now impossible to replace the typoutput
        of existing data types with new procs.

2)      The identd hba fails after the first time because the data read
        from the identd socket is not zero-terminated and strlen reports
        an incorrect length if the stack contains garbage, which usually
        happens after the first connection has been made.

3)      The new initdb wants to create itself the data directory. This
        implies that the parent directory must be writable by postgres and
        this may not always be desirable.  A better solution would be to
        allow the directory to be created by root and then filled by initdb.
        It would also nice to have some reasonable default for PGLIB and
        PGDATA like the previous version did.  This applies also to the
        postmaster executable.
1997-01-10 17:40:07 +00:00
Vadim B. Mikheev 41857f3ca2 Additional fixes for shared library (BSD44_Derived port). 1997-01-10 04:01:09 +00:00
Marc G. Fournier 389e336ca9 From: wieck@sapserv.debis.de
Hi,

    counting the empty dummy queries in libpq isn't everything.
    If the backend sends an error, the I returns from the dummies
    still come. So we must eat them up in any case, not just
    returning on the occurence of an E reply.

Until later, Jan
1997-01-08 23:25:32 +00:00
Marc G. Fournier 5aea6a0bca minor path problem fix by tgl@mythos.jpl.nasa.gov 1997-01-08 07:32:58 +00:00
Bryan Henderson 14800311d2 Fix mismatching prototype (const int vs int) 1997-01-06 10:11:11 +00:00
Marc G. Fournier 5b104c30e9 NeXT port specific changes by: Ovidiu Predescu <ovidiu@bx.logicnet.ro> 1997-01-06 00:24:24 +00:00
Marc G. Fournier 0865f587ea Shared library fixes for BSD44_Derived port
Submitted by: "Martin J. Laubach" <mjl@wwx.vip.at>

NOTE: The following patch I was uncertain of, but applied it...will end up
	testing the compile on my machine later tonight anyway, but if anyone
	knows why this *shouldn't* have been done, please change it. (CC -> LD)

***************
*** 61,68 ****
  ../backend/lib/dllist.o:
        $(MAKE) -C ../backend/lib dllist.o

! libpq.so.1: $(OBJS)
!       $(CC) $(LDFLAGS) -shared $(OBJS) -o libpq.so.1

  c.h: ../include/c.h
        rm -f c.h
--- 66,73 ----
  ../backend/lib/dllist.o:
        $(MAKE) -C ../backend/lib dllist.o

! $(shlib): $(OBJS)
!       $(LD) $(LDFLAGS) -shared $(OBJS) -o $(shlib)

  c.h: ../include/c.h
        rm -f c.h
1997-01-05 23:52:21 +00:00
Marc G. Fournier b5164666a3 someone added pg_listen and pg_notifies to libpgtcl. But first
these routines try to use the old pointer casting stuff to get
    the connection id, second the notification hash table should
    be part of the cliendData. Otherwise, one interpreter might
    eat up the notifies for another one.

    Please apply the patch below to the current 6.0 tree.

Submitted by: wieck@sapserv.debis.de
1997-01-03 18:48:31 +00:00
Bryan Henderson 8fb0ac8898 Make error messages more explicit, PQtrace() output more readable. 1996-12-31 07:29:17 +00:00
Bruce Momjian cb6cb7745d Here's the final set of patches to 6.0 (sup'd on 27/12/96) that allow a full
gmake of the code without interruption.

There's also some tidy-up of the MAXPATHLEN stuff based on the assumption that
all supported platforms have MAXPATHLEN defined in <sys/param.h>.

(The only unknowns for the above are AIX and IRIX5.)
1996-12-28 02:13:05 +00:00
Bruce Momjian d4dbfdb4c0 Patch for copy from stdin. 1996-12-28 01:57:13 +00:00
Bryan Henderson af30fe7852 Remove use of "bool", which user program may not have defined. 1996-12-26 23:27:16 +00:00
Bruce Momjian e8f43854ac pq/signal() portability patch. Also psql copy prompt fix. 1996-12-26 22:08:34 +00:00
Bryan Henderson 9b55904647 Clarify error message about trying to PQgetvalue() nonexistent row. 1996-12-24 09:03:16 +00:00
Bruce Momjian 4540a8bd5c Fix multiple "C" from backend. 1996-12-20 20:34:38 +00:00
Marc G. Fournier 56e8243d22 Add two new comments to pglibtcl...
From: Massimo Dal Zotto <dz@cs.unitn.it>
1996-12-19 05:02:51 +00:00
Bryan Henderson 9fc7250d3a Make compile on AIX, Alpha OSF. Thanks Darren King, Igor Notanzon. 1996-12-15 09:05:53 +00:00
Bryan Henderson 255363f859 Clean up. Get rid of tabs and overly long lines. 1996-12-13 09:25:08 +00:00
Bryan Henderson 7f36a2a718 Fix bug: libpq clients (which include libpq-fe.h) won't compile. 1996-12-10 07:05:12 +00:00
Bryan Henderson 9005a38bdb Change portname "sparc" to "sunos4" and change some portname dependencies to
feature dependencies.  Thanks Kurt J. Lidl.
1996-12-04 03:06:33 +00:00
Bryan Henderson f0e7004d29 Make strdup work for Ultrix. Thanks Erik Bertelsen 1996-11-28 03:32:18 +00:00
Bryan Henderson 93f722536f Whoops, redo Ultrix patch so the other ports still compile. 1996-11-26 07:39:11 +00:00
Bryan Henderson c118543186 Fix double-colon syntax error on fe-lobj.o. 1996-11-26 06:33:18 +00:00
Bryan Henderson 46d58fba33 Make it compile on Ultrix. Thanks Erik Bertelson. 1996-11-26 03:20:35 +00:00
Bryan Henderson 4da9c597af Include stdio.h to fix Craig Anderson's compile problem. 1996-11-22 04:39:53 +00:00
Bruce Momjian 8299e75577 following is a little fix for libpq.
PQexec  handles  the possibility of multiple results from one
    query by simply submitting an empty  query  after  the  first
    result and waiting for an 'I' message.

    Rules  can  generate  errors with transaction abort after the
    first 'C' message was recieved (e.g. if a C-language function
    used  in  a rule calls elog(WARN, ...)). Thus we have to look
    for.

Jan(wieck@sapserv.debis.de)
1996-11-20 22:35:19 +00:00
Bryan Henderson 435d4f4a79 Quiet compiler warnings, ignore the ones we can't. 1996-11-18 01:44:28 +00:00
Bryan Henderson e780f0fef3 Ignore compiler warnings, because we can't escape "abstract declarator used
as declaration".
1996-11-18 01:43:55 +00:00
Bruce Momjian 99a4dc0598 Copy needed include files into standard directory. 1996-11-17 19:27:38 +00:00
Bruce Momjian 4024d43069 Added include file needed by memset(). 1996-11-16 05:18:58 +00:00
Bryan Henderson f64b840387 Remove most compile-time options, add a few runtime options to make up for it.
In particular, no more compiled-in default for PGDATA or LIBDIR.  Commands
that need them need either invocation options or environment variables.
PGPORT default is hardcoded as 5432, but overrideable with options or
environment variables.
1996-11-14 10:25:54 +00:00
Bryan Henderson b20766ccc4 Eliminate MKDIR, srcdir, objdir. Centralize setting of LIBPQDIR. 1996-11-13 10:36:36 +00:00