Commit Graph

4569 Commits

Author SHA1 Message Date
Marc G. Fournier 8217202134 From: "Martin J. Laubach" <mjl@CSlab.tuwien.ac.at>
Subject: [PATCHES] libpq SET var TO patch

  One last, I hope. This one corrects a bogus format string, and
actually sends the contents of PG_DATESTYLE to the backend. That
means, you can do a setenv PG_DATESTYLE 'iso', and your libpq
will pick that up and tell the backend.
1997-05-07 03:13:50 +00:00
Thomas G. Lockhart ef2821d0d6 Change LOread() and LOwrite() to loread() and lowrite() to allow use
with case-insensitive SQL parser.
1997-05-06 07:19:04 +00:00
Edmund Mergl 0aba92a2c5 creation for postgresql-6.1 1997-04-29 19:37:10 +00:00
Marc G. Fournier cbaa98835c From: Raymond Toy <toy@rtp.ericsson.se>
Subject: [PATCHES] 970417:  some large object patches


Two patches here, made against 970417.  Both have to do with large
objects:

        1.  lobjfuncs was not initialized in PQconnectdb.  This causes
            failure later if large objects are used.  (Someone already
            caught this error in PQsetdb.)

        2.  Postgres functions lo_import and lo_export sometimes
            produce garbage for the file names because the filename
            strings aren't always terminated by \0.  (VARDATA isn't
            necessarily null terminated.)
1997-04-17 20:39:31 +00:00
Vadim B. Mikheev be0e8f7fb0 connectDB(): setsockopt (..., TCP_NODELAY, ...) added. 1997-04-16 06:29:19 +00:00
Marc G. Fournier cacaaed62b A couple of cleanups from Scott Harrison <Scott_Harrison@next.com> 1997-04-15 19:08:13 +00:00
Marc G. Fournier c7b40e6058 This commit represents a clean compile with the new templates under
FreeBSD

The Makefile(s) have all been cleaned up such that there is a single
LDFLAGS vs LD_ADD or LDADD or LDFLAGS or LDFLAGS_BE.  The Makefile(s)
should be alot more straightforward then they were before...and
consistent
1997-04-04 10:43:16 +00:00
Marc G. Fournier 82a27f230a Install os.h when we install the other headers...
Pointed out by: System Administrator <sysadmin@sba.miami.edu>
1997-04-04 02:53:14 +00:00
Marc G. Fournier 920c58df71 From: "Martin J. Laubach" <mjl@CSlab.tuwien.ac.at>
Subject: [HACKERS] libpq variable set patch

  Just a small change, so the automatic variable setting on
connection startup actually works...
1997-04-02 18:26:25 +00:00
Marc G. Fournier 17b5bd33e4 From: Anton de Wet <adw@obsidian.co.za>
Subject: [HACKERS] Small patch to pgtclCmds.c

Hi I have made the following small change to the extensions I made to
pgtclCmds.c quite a while ago.

At the moment there is a -assignbyidx option to pg_result assigning the
returned tuples to an array by using the 1st field of the select statement
as the key to the array.
eg "select name,age from vitalstatistics" will result in an array with

myarray(peter) = 32
myarray(paul)  = 45

Often I need to have a pseudo-multi dimentional
array eg. "select name,age from vitalstatistics where occupation='plummer'

I would like to be able to generate an array
newarray(peter,overpaid) = 32

So to add a arbitrary string to the key value I have extended

  pg_result $res -assignbyidx $arrayname

to have an optional argument

  pg_result $res -assignbyidx $arrayname $appendstr

So that that string is appended to the key value.
1997-04-02 18:16:49 +00:00
Marc G. Fournier 5b1311acfb From: Oleg Bartunov <oleg@sai.msu.su>
Subject: [HACKERS] locale patches !

Hi there,

here are little patches to get Postgres 6.1 works with locale stuff.
This is a patch against 970402.tar.gz, there are no problem to apply them
by hand to 6.0 release. Collate stuff tested about 1-2 months in real
working database but I'm sure there must be no problem. US hackers
could vote against locale implementation ( locale for sure will affect to
speed of postgres ), so I introduce variable USE_LOCALE which
controls locale stuff. Non-US users now could use ~* operator
for searching and <order by> for strings with nation alphabet.
Please, don't forget, as I did first time, to set environment variable
LC_CTYPE and LC_COLLATE because backend get locale information from them.
I start postmaster from a little script, assuming that shell is Bash shell
it looks like:

#!/bin/sh

export LC_CTYPE=koi8-r
export LC_COLLATE=koi8-r
postmaster -B 1024 -S -D/usr/local/pgsql/data/ -o '-Fe'
1997-04-02 18:13:47 +00:00
Marc G. Fournier c2e73db87a Various patches for shared libraries under i386-solaris by:
Christoph Kaesling <ck@dog.pfalz.sub.de>
1997-03-25 09:21:59 +00:00
Marc G. Fournier 6304e2c273 Here's two more diffs...
The first fixes a warning from gcc about the assignment within the condition.
The extra set of parens should not make a difference, but with -Werror, they
are necessary.

The second fixes an "ln -s" invocation that assumes the current directory is
implicitly the target if not specified.  Not true in all cases, and again, it
should not make a difference except to those implementation that it does.

From: "Michael P. Snyder" <msnyder@hawkeye.huntersmoon.com>
1997-03-25 09:08:06 +00:00
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
Bryan Henderson b269793975 Forgot in yesterday's make file blitz. 1996-11-13 06:36:38 +00:00
Bryan Henderson d7dd9295b7 End of the make file simplifications. 1996-11-12 11:43:32 +00:00
Marc G. Fournier 41b8c2c849 As proposed,
following is the patch to libpq's large object interface that
    removes the requirement to  include  fmgr.h  into  fe-lobj.c.
    The  large object interface now ask's the backend to tell the
    OID's of all the required functions in pg_proc.

From: wieck@sapserv.debis.de (Jan Wieck)
1996-11-11 12:16:57 +00:00
Marc G. Fournier 2bdded3540 Various cleanups from D'Arcy 1996-11-11 12:14:45 +00:00
Bruce Momjian aaeef4d17d All external function definitions now have prototypes that are checked. 1996-11-10 03:06:38 +00:00
Bryan Henderson 2e21b7e4bc Add #include <ctype.h> to quiet compiler about missing declaration of isspace(). 1996-11-10 01:46:14 +00:00
Marc G. Fournier 4aa1734f36 Added in PQconnectdb() function
Submitted by: wieck@sapserv.debis.de (Jan Wieck)
1996-11-09 10:39:54 +00:00
Bruce Momjian a0990e1884 Makefile cleanup after reorganization 1996-11-09 06:24:51 +00:00
Bruce Momjian 78078236ea Fix typo in file name found during install. 1996-11-08 21:40:11 +00:00
Bruce Momjian 4b2b8592a0 Compile and warning cleanup 1996-11-08 06:02:30 +00:00
Marc G. Fournier 2768f391a4 There is a problem in the Makefile of libpgtcl on linux (and maybe also on
other platforms).  If I do the standard make + make install the shared library
is not linked with the the libpq library and when I try to load it in the
standard Tcl or Tk shell I get a lot of unresolved symbols.  The bug doesn't
affect pgtclsh because it is linked also with libpq. The problem exists only
when using the dynamic load feature of Tcl7.5.


From: Massimo Dal Zotto <dz@cs.unitn.it>
1996-11-08 00:58:07 +00:00
Bryan Henderson 089dfb61f0 Add ability to deal with the fmgr.h dependency. 1996-11-04 06:32:59 +00:00
Bruce Momjian 5061c23ac2 Rename CDEBUG to COPT 1996-11-04 05:15:07 +00:00
Bruce Momjian 7e42f4814d Removed PORTNAME_. Use OS version only. 1996-11-04 04:00:56 +00:00
Marc G. Fournier 4bdf308bdf shared build fails, but the rest compiles...formatting error in the
cc -shared, I believe...
1996-11-03 07:14:32 +00:00
Bryan Henderson b216c1eac6 Continuation of make file simplification; deal with header file shuffle. 1996-11-02 09:54:44 +00:00
Bruce Momjian d91cc297bb Changed include path. 1996-10-31 05:58:32 +00:00
Marc G. Fournier 552620c8b2 Changes to libpgtcl submitted by: wieck@sapserv.debis.de (Jan Wieck)
Adds:

    -lAttributes

        Returns another format of the results attribute list. Per
        attribute a sublist  of  {{attname}  atttype  attlen}  is
        returned  and  an  empty  string  if  no attributes where
        received.

    -numAttrs

        Returns the number of attributes in the result.
1996-10-30 06:18:42 +00:00
Bryan Henderson aa71f918c3 Fix sigaction again to try for portability. 1996-10-29 21:53:48 +00:00
Bryan Henderson e18d49d82a Add CFLAGS+=-DPOSTPORT=... so we can take it out of the global CFLAGS. 1996-10-25 09:22:30 +00:00
Bryan Henderson 6cbaa93b82 Change treatment of sigaction structure again to include even more platforms.
Thanks D'Arcy.
1996-10-16 09:41:13 +00:00
Bryan Henderson ec610a7696 Remove 4th element of sigaction structure so it works on more platforms. 1996-10-15 07:16:41 +00:00
Bruce Momjian 86be8677a9 Added consistent include file handling for MAXHOSTNAMELEN.
If I have introduced any syntax errors with this, I will patch them in
the morning, and Marc will have a good laugh.
1996-10-13 04:50:27 +00:00
Bryan Henderson 329b38eebb Add PGUSER environment variable for client to specify Postgres username. 1996-10-10 08:20:11 +00:00
Marc G. Fournier 4e8f5c337c Well I haven't received any feedback pro or con re my suggested new Tcl
function so I am going to assume that it is such a good idea that no
one sees any point in discussing it.  :-)  I have made two changes -
I have merged this into pgtclCmds.c and I have taken out any code for
updating tuples after the loop body runs.  See comments for discussion
of this.

I have also fixed up the error checking stuff so that break, continue
and syntax errors have the expected result.

Submitted by: D'Arcy Cain
1996-10-07 21:19:09 +00:00
Bruce Momjian fd067981be Fix location of include files to match postgres.h includes. 1996-09-25 19:37:31 +00:00
Marc G. Fournier afcbce5c22 CFLAGS +- -I... got messed by one of Bryan's patches
Fix Submitted by: Bryan himself :)
1996-09-23 18:14:08 +00:00
Marc G. Fournier ff4d0d435e Here's a patch that I discussed recently on pg95-dev that changes the
way one creates a database system.  Parts that were in "make install"
are not either in "make all" or initdb.  Nothing goes in the PGDATA
directory besides user data.  Creating multiple database systems is
easier.

In addition to applying the patch, it is necessary to move the file
libpq/pg_hba to backend/libpq/pg_hba.sample.

Submitted by: Bryan Henderson <bryanh@giraffe.netgate.net>
1996-09-23 08:24:13 +00:00
Marc G. Fournier 24f0012268 I have made some corrections to my previous patches for retrieving array
attributes as tcl arrays.  The previous code had problems with some chars
used as delimiter by Tcl.  The new code should be more robust.

By: Massimo Dal Zotto <dz@cs.unitn.it>
1996-09-16 05:54:53 +00:00
Marc G. Fournier bbebcb125e Fixes:
Async notifies received while a backend is in the middle of a begin/end
transaction block are lost by libpq when the final end command is issued.

The bug is in the routine PQexec of libpq. The routine throws away any
message from the backend when a message of type 'C' is received. This
type of message is sent when the result of a portal query command with
no tuples is returned. Unfortunately this is the case of the end command.
As all async notification are sent only when the transaction is finished,
if they are received in the middle of a transaction they are lost in the
libpq library. I added some tracing code to PQexec and this is the output:

Submitted by: Massimo Dal Zotto <dz@cs.unitn.it>
1996-09-16 05:50:46 +00:00
Marc G. Fournier 28fad34c7b modifications required to reflect centralized include files 1996-08-28 23:02:43 +00:00
Marc G. Fournier e2c9fd8e87 |May I suggest to add access to the oid of an inserted
|record, by a small patch to libpq++? At least until the
|feature that will allow dumped oid's to be re-loaded into
|a database becomes available, I need access to the oids
|of newly created records... To this end, I have written a
|three-line wrapper for the PQoidStatus function in libpq and
|named this wrapper OidStatus() (I'd appreciate suggestions for
|a name that would better fit into the general naming scheme).
|
|Regards,
|
|Ernst
|
1996-08-21 04:32:09 +00:00
Marc G. Fournier 0e9f4ceae0 Here's a minor fix that fixes a casting problem:
-Kurt
1996-08-19 13:38:42 +00:00
Marc G. Fournier 77e01653bc Fixes:
When you connect to a database with PQsetdb, as with psql, depending on
how your uninitialized variables are set, you can get a failure with a
"There is no connection to the backend" message.

The fix is to move a call to PQexec() from inside connectDB() to
PQsetdb() after connectDB() returns to PQsetdb().  That way a connection
doesn't have to be already established in order to establish it!


From:  bryanh@giraffe.netgate.net (Bryan Henderson)
1996-08-19 13:25:40 +00:00
Marc G. Fournier bde34552a2 |
|Here is a fix for the psql alignment problem.  It turns out that libpq
|was trying to determine if the column contained only numeric values so
|it could right justify it.  The 'e' values were taked as exponient
|values and all columns were considered numeric.
|
|The patch excludes 'e' and 'E' as being valid first-column numeric
|values.
|

Submitted by: Bruce...
1996-08-14 16:44:51 +00:00
Marc G. Fournier 011ee13131 |
|We're all too familiar with psql's "no response from backend" message.
|Users can't tell what this means, and psql continues prompting for
|commands after it even though the backend is dead and no commands can
|succeed.  It eventually dies on a signal when the dead socket fills
|up.  I extended the message to offer a better explanation and made
|psql exit when it finds the backend is dead.
|
|I also added a short message and newline when the user does a ctl-D so
|it doesn't mess up the terminal display.
|
|

Submitted by: Bryan Henderson <bryanh@giraffe.netgate.net>
1996-08-14 04:56:55 +00:00
Marc G. Fournier 9305fc748c Fixes:
Attached is a patch to allow libpq to determine if a field is null.

This is needed because text fields will return a PQgetlength() of 0
whether it is '' or NULL.  There is even a comment in the source noting
the fact.

I have changed the value of the 'len' field for NULL result fields.  If
the field is null, the len is set to -1 (NULL_LEN).  I have changed
PQgetlength() to return a 0 length for both '' and NULL.  A new function
PQgetisnull() returns true or false for NULL.

The only risk is to applications that do not use the suggested
PQgetlength() call, but read the result 'len' field directly.

As this is not recommended, I think we are safe here.

A separate documentation patch will be sent.


Submitted by: Bruce Momjian <maillist@candle.pha.pa.us>
1996-08-13 01:34:29 +00:00
Marc G. Fournier 4db7f15b2a Updates to libpq to fix breakage in previous patch...
Submitted by: darcy@druid.druid.com (D'Arcy J.M. Cain)
1996-08-10 00:22:48 +00:00
Marc G. Fournier c4e53a1411 Fixes for:
Here are a few minor fixes to Postgres95.  Mostly I have added const
to some of the char pointers.  There was also a missing header file
and a place where it looks like "==" was used when "=" was meant.
I also changed some variables from Pfin and Pfout tp pfin and pfout
because the latter shadow global variables and that just seems like
an unsafe practice which I like to avoid.

Submitted by:  "D'Arcy J.M. Cain" <darcy@druid.druid.com>
1996-08-06 16:16:50 +00:00
Marc G. Fournier 4d837e370c Change the TEMPDIR to be obj instead of /tmp
Suggested by: Michael Babcock <michael@kanji.com>
1996-08-01 05:04:29 +00:00
Marc G. Fournier 4e82924eac Row count patch from Bruce 1996-07-31 18:40:12 +00:00
Marc G. Fournier dbf2a8c984 Everyone seems to suggestion this is something that should be there...
#include <sys/termios.h>

Submitted by: Dr. George
1996-07-31 06:05:46 +00:00
Marc G. Fournier 3881cbd2f6 Added <sys/termios.h> for i386_solaris port
Submitted by: Dr_George_D_Detlefsen <drgeorge@ilt.com>
1996-07-31 02:20:59 +00:00
Marc G. Fournier e0d48c317c Fixes: Floating point exception in psql
Submitted by: Dan McGuirk <mcguirk@indirect.com>
1996-07-31 02:06:00 +00:00
Marc G. Fournier c4ea55d2c9 clean up /tmp behind itself
submitted by: bruce
1996-07-29 20:52:24 +00:00
Marc G. Fournier b834d27bc9 small port fixes for sparc_solaris
submitted by: jason
1996-07-28 06:54:15 +00:00
Marc G. Fournier edb519b14c and now, the long awaited PAGER patches from Bruce...
Submitted by: Bruce Momjian <maillist@candle.pha.pa.us>
1996-07-27 02:55:23 +00:00
Marc G. Fournier c13ef1afed My patch to fe-connect.c introduced a new bug which is triggered only, if
Kerberos is being used (attempt to free static memory).
The error was caused by a confusing doublespeak of fe_getauthname():
Returns a pointer to static memory, if you authenticate via Kerberos,
a pointer to dynamic memory otherwise.

Submitted by: Erich Stamberger <eberger@gewi.kfunigraz.ac.at>
1996-07-27 02:27:55 +00:00
Julian Assange 23c7ff0b3c PQprint() routines. The older code is still there for historical
compatibility. There isn't much difference here against my previous
PQprint() code, except that you can add optional arguments to the
<table args> in html.
1996-07-25 06:21:11 +00:00
Marc G. Fournier 83c9ec765e Last changes to src from Dr. George *wipes brow* 1996-07-23 03:38:44 +00:00
Marc G. Fournier 2206b5819d Alot of "changes" from Dr. George's source tree...
Most of the changes in here look to b epurely cosmetic, and don't
affect anything...

...and some stuff is completely questionable...in that I may have reversed
some of the stuf fwe already had :(
1996-07-23 03:35:14 +00:00
Marc G. Fournier 3704b99522 - libpq calls "fe_getauthname()" two times in "fe-connect.c", but
doesn't free the buffer allocated by this function.

- submitted by: Erich Stamberger <eberger@gewi.kfunigraz.ac.at>
1996-07-19 07:00:56 +00:00
Marc G. Fournier de82ece8bd Fix PAGER bug in createuser/etc scripts
submitted by: Bruce Momjian (root@candle.pha.pa.us)
1996-07-19 06:36:38 +00:00
Marc G. Fournier 72f76d38eb libpq and psql.c have been modified to do various things they didn't do
before (plus some optimisations/bug fixes et al).  I've included a small
demo transcript below. Note that all of of the display
functionality/intelligence you see here, can be had merely by calling
the new LIBPQ PQprint() routine with the appropriate arguments/options,
including the HTML3 output guff.


submitted by:  Julian Assange <proff@suburbia.net>
1996-07-18 05:48:57 +00:00
Marc G. Fournier e72ca17f77 fixes for several potential null pointer dereferences
submitted by: Paul "Shag" Walmsley <ccshag@cclabs.missouri.edu>
1996-07-12 04:53:59 +00:00
Marc G. Fournier d31084e9d1 Postgres95 1.01 Distribution - Virgin Sources 1996-07-09 06:22:35 +00:00