Subject: [[email-masked]: Re: destroyuser]

From: [email-masked] (Leland Ellis)
Date: Mon, 9 May 1994 11:47:16 +0600

This fixed the problem w/ destroyuser (Sun SS10, SunOs 4.1.3, Postgres 4.2).

Cheers,

Leland

Date: Mon, 9 May 1994 09:20:12 +0800
From: [email-masked] (Frank Delahoyde)
To: [email-masked]
Subject: Re: destroyuser
Content-Length: 843

This is a bug (at least for Sun sh). A simple fix is included (from the
top of your Postgres distribution, patch -p0 <thisPatch, then from your
src directory, bmake all install).

    _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
   _/    Frank M. Delahoyde    _/ Phone: 619.534.1901        _/
  _/   SIO STS/ODF M/C 0214   _/ Fax: 619.534.7383          _/
 _/ La Jolla, Ca. 92093-0214 _/ Email: [email-masked]  _/
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

*** src/bin/destroyuser/destroyuser.sh.orig	Mon May  9 09:03:38 1994
--- src/bin/destroyuser/destroyuser.sh	Mon May  9 09:04:40 1994
***************
*** 85,90 ****
--- 85,91 ----
  QUERY='retrieve (pg_user.usesysid) where pg_user.usename = '"\"$DELUSER\""
  
  RES=`$MONITOR -c "$QUERY" template1`
+ RES=`echo -n $RES`
  
  if [ $? -ne 0 ]
  then

-------------------------------------------------------------------------------

Leland Ellis, Ph.D.
Professor of Biochemistry and Biophysics
Director, W.M. Keck Center for Genome Informatics
Institute of Biosciences and Technology
Texas A&M University
2121 Holcombe
Houston, Texas  77030
email: [email-masked]
URL:   http://keck.tamu.edu/ibt.html

===============================================================================
    To add/remove yourself from the POSTGRES mailing list: send mail with 
    the subject line ADD or DEL to "[email-masked]"

    If this fails, send mail to "[email-masked]" and
    a human will deal with it.  DO NOT post to the "postgres" mailing list.
===============================================================================

---

From: [email-masked] (Kai Petzke)
Date: Tue, 10 May 1994 09:38:32 +0200 (MET DST)

> src directory, bmake all install).

GNU Bourne Again Shell (bash) has the same problem, too.  For a fix,
I changed the function, which reads integers, to be less pedantic
about trailing blanks.  Apply this patch from the main postgres dir,
then do a "bmake install" in ~postgres/src/backend.

Kai

*** src/backend/utils/adt/numutils.c.old	Sat Apr  2 00:44:23 1994
--- src/backend/utils/adt/numutils.c	Wed Apr 20 10:50:26 1994
***************
*** 32,40 ****
      l = strtol(s, &badp, 10);
      if (errno)		/* strtol must set ERANGE */
  	elog(WARN, "pg_atoi: error reading \"%s\": %m", s);
!     if (badp && *badp && (*badp != c))
! 	elog(WARN, "pg_atoi: error in \"%s\": can\'t parse \"%s\"", s, badp);
  
      switch (size) {
      case sizeof(int32):
  #ifdef PORTNAME_alpha
--- 32,48 ----
      l = strtol(s, &badp, 10);
      if (errno)		/* strtol must set ERANGE */
  	elog(WARN, "pg_atoi: error reading \"%s\": %m", s);
!     /*
!      * ignore trailing blanks!
!      */
!     if (badp) {
! 	while((*badp == ' ' || *badp == '\n' || *badp == '\t') && *badp != c)
! 	    badp++;
  
+ 	if(*badp && (*badp != c))
+ 	    elog(WARN, "pg_atoi: error in \"%s\": can\'t parse \"%s\"", s, badp);
+     }
+ 
      switch (size) {
      case sizeof(int32):
  #ifdef PORTNAME_alpha