[PATCHES] UPDATED UnixWare Threads Patch.

2003-08-09 Thread Larry Rosenman


Here is the updated UnixWare threads patch.  I need some help to set the
HAVE_POSIX_GETPWUID_R define from configure, but this will suffice for now.
This also includes my recommendation for the Compiler Bug issue.

Please Apply, and if one of the configure guru's can help here, I'd be most 
appreciative.

LER

Index: src/port/thread.c
===
RCS file: /projects/cvsroot/pgsql-server/src/port/thread.c,v
retrieving revision 1.2
diff -u -r1.2 thread.c
--- src/port/thread.c	8 Aug 2003 03:09:56 -	1.2
+++ src/port/thread.c	8 Aug 2003 23:53:35 -
@@ -40,13 +40,18 @@
pqGetpwuid(uid_t uid, struct passwd * resultbuf, char *buffer,
		   size_t buflen, struct passwd ** result)
{
-#if defined(USE_THREADS)  defined(HAVE_GETPWUID_R)
+#if defined(USE_THREADS)  defined(HAVE_GETPWUID_R)  
!defined(HAVE_POSIX_GETPWUID_R)

	/*
	 * broken (well early POSIX draft) getpwuid_r() which returns 'struct
	 * passwd *'
	 */
	*result = getpwuid_r(uid, resultbuf, buffer, buflen);
+#elsif defined(USE_THREADS)  defined(HAVE_GETPWUID_R)  
defined(HAVE_POSIX_GETPWUID_R)
+	/*
+	 * SUSv2/POSIX getpwuid_r
+	 */
+	return getpwuid_r(uid, resultbuf, buffer, buflen, result);
#else
	/* no getpwuid_r() available, just use getpwuid() */
	*result = getpwuid(uid);
Index: src/template/unixware
===
RCS file: /projects/cvsroot/pgsql-server/src/template/unixware,v
retrieving revision 1.11
diff -u -r1.11 unixware
--- src/template/unixware	4 Sep 2002 22:54:18 -	1.11
+++ src/template/unixware	8 Aug 2003 23:53:35 -
@@ -1,5 +1,13 @@
+SUPPORTS_THREADS=yes
if test $GCC = yes; then
-  CFLAGS=-O2
+  CFLAGS=-O2 -DHAVE_POSIX_GETPWUID_R
+  THREAD_CFLAGS=-pthread -D_REENTRANT
+  NEED_REENTRANT_FUNC_NAMES=yes
else
-  CFLAGS='-O -K inline'
+# the -Kno_host is temporary for a bug in the compiler.  See -hackers
+# discussion on 7-8/Aug/2003.
+# when the 7.1.3UP3 or later compiler is out, we can do a version check.
+  CFLAGS='-O -Kinline,no_host  -DHAVE_POSIX_GETPWUID_R'
+  THREAD_CFLAGS=-D_REENTRANT -K pthread -DHAVE_POSIX_GETPWUID_R
+  NEED_REENTRANT_FUNC_NAMES=yes
fi

--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 972-414-9812 E-Mail: [EMAIL PROTECTED]
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749


pg.patch.2003-08-08
Description: Binary data

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faqs/FAQ.html


[PATCHES] misc doc fixes

2003-08-09 Thread Neil Conway
This patch makes two minor fixes to the docs: (1) fixes a
spelling mistake in the PREPARE ref page (2) Makes some
English more consistent, in the ref pages for some of the
client apps (3) Adds a link to the libpq docs in the
vacuumdb ref page.

-Neil

Index: doc/src/sgml/ref/clusterdb.sgml
===
RCS file: /home/neil/cvsup/cvs/pgsql-server/doc/src/sgml/ref/clusterdb.sgml,v
retrieving revision 1.10
diff -c -r1.10 clusterdb.sgml
*** doc/src/sgml/ref/clusterdb.sgml 18 Jun 2003 12:19:11 -  1.10
--- doc/src/sgml/ref/clusterdb.sgml 9 Aug 2003 08:39:56 -
***
*** 129,138 
termoption--host replaceable 
class=parameterhost/replaceable//term
listitem
 para
!   Specifies the host name of the machine on which the 
!   server
!   is running.  If the value begins with a slash, it is used 
!   as the directory for the Unix domain socket.
 /para
/listitem
   /varlistentry
--- 129,137 
termoption--host replaceable 
class=parameterhost/replaceable//term
listitem
 para
!   Specifies the host name of the machine on which the server is
!   running.  If the value begins with a slash, it is used as the
!   directory for the Unix domain socket.
 /para
/listitem
   /varlistentry
***
*** 182,188 
termcomputeroutputCLUSTER/computeroutput/term
listitem
 para
! Everything went well.
 /para
/listitem
   /varlistentry
--- 181,187 
termcomputeroutputCLUSTER/computeroutput/term
listitem
 para
! The database was successfully clustered.
 /para
/listitem
   /varlistentry
Index: doc/src/sgml/ref/createuser.sgml
===
RCS file: /home/neil/cvsup/cvs/pgsql-server/doc/src/sgml/ref/createuser.sgml,v
retrieving revision 1.34
diff -c -r1.34 createuser.sgml
*** doc/src/sgml/ref/createuser.sgml6 Jun 2003 15:31:46 -   1.34
--- doc/src/sgml/ref/createuser.sgml9 Aug 2003 08:43:19 -
***
*** 276,282 
termcomputeroutputCREATE USER/computeroutput/term
listitem
 para
! All is well.
 /para
/listitem
   /varlistentry
--- 276,282 
termcomputeroutputCREATE USER/computeroutput/term
listitem
 para
! The user was successfully created.
 /para
/listitem
   /varlistentry
Index: doc/src/sgml/ref/dropuser.sgml
===
RCS file: /home/neil/cvsup/cvs/pgsql-server/doc/src/sgml/ref/dropuser.sgml,v
retrieving revision 1.26
diff -c -r1.26 dropuser.sgml
*** doc/src/sgml/ref/dropuser.sgml  18 Jun 2003 12:19:11 -  1.26
--- doc/src/sgml/ref/dropuser.sgml  9 Aug 2003 08:45:29 -
***
*** 180,186 
termcomputeroutputDROP USER/computeroutput/term
listitem
 para
! All is well.
 /para
/listitem
   /varlistentry
--- 180,186 
termcomputeroutputDROP USER/computeroutput/term
listitem
 para
! The user was successfully removed.
 /para
/listitem
   /varlistentry
Index: doc/src/sgml/ref/prepare.sgml
===
RCS file: /home/neil/cvsup/cvs/pgsql-server/doc/src/sgml/ref/prepare.sgml,v
retrieving revision 1.4
diff -c -r1.4 prepare.sgml
*** doc/src/sgml/ref/prepare.sgml   26 Apr 2003 23:56:51 -  1.4
--- doc/src/sgml/ref/prepare.sgml   9 Aug 2003 08:42:06 -
***
*** 130,136 
 In some situations, the query plan produced by for a prepared
 statement may be inferior to the plan produced if the statement
 were submitted and executed normally. This is because when the
!statement is planned and the planer attempts to determine the
 optimal query plan, the actual values of any parameters specified
 in the statement are
 unavailable. productnamePostgreSQL/productname collects
--- 130,136 
 In some situations, the query plan produced by for a prepared
 statement may be inferior to the plan produced if the statement
 were submitted and executed normally. This is because when the
!statement is planned and the planner attempts to determine the
 optimal query plan, the actual values of any parameters specified
 in the statement are
 unavailable. productnamePostgreSQL/productname collects
Index: doc/src/sgml/ref/vacuumdb.sgml
===
RCS file: /home/neil/cvsup/cvs/pgsql-server/doc/src/sgml/ref/vacuumdb.sgml,v
retrieving revision 1.29
diff -c -r1.29 vacuumdb.sgml
*** doc/src/sgml/ref/vacuumdb.sgml  18 Jun 2003 12:19:11 -  1.29
--- 

Re: [PATCHES] psql \d should use pg_get_viewdef (oid, true)

2003-08-09 Thread Bruce Momjian

Your patch has been added to the PostgreSQL unapplied patches list at:

http://momjian.postgresql.org/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---


Christopher Kings-Lynne wrote:
 OK,
 
 This makes psql use the new pg_get_viewdef function.  It also puts one extra
 line break in to improve formatting.
 
 Chris

[ Attachment, skipping... ]

 
 ---(end of broadcast)---
 TIP 7: don't forget to increase your free space map settings

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faqs/FAQ.html


Re: [PATCHES] [HACKERS] IS OF

2003-08-09 Thread Joe Conway
Tom Lane wrote:
In fact you could argue that our current behavior is *more* useful than
what the spec says for polymorphics.  You would not want the special
case for NULLs, in most cases, I'd think.  NULLs have perfectly well
defined datatype.
That's actually exactly what I was thinking.

However, it troubles me to be using a spec-defined syntax for a behavior
that is not standard.  I'd prefer to change the syntax if we are going
to keep the behavior.  That probably puts it in the too late for 7.4
category.  So I'm inclined to follow the path of leaving it undocumented
for now, implementing a new syntax in 7.5, and documenting it under that
syntax then.
Sounds good to me.

Thanks,

Joe



---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
   (send unregister YourEmailAddressHere to [EMAIL PROTECTED])


[PATCHES] logging enhancements, minor code cleanup

2003-08-09 Thread Andrew Dunstan
The attached patch does 3 things:

. logs connection ends if log_connections = true
. provides a new option log_line_format which allows addition of extra 
information on a log line before the keyword. Currently supported are 
user name and database name, but it is easily extensible. The string is 
in the flavor of a printf format, where %U means user name, %D means 
database name, %% means % and anything else means itself, literally.
. minor code cleanup for consistency in calling gettimeofday().

cheers

andrew
Index: backend/commands/vacuum.c
===
RCS file: /projects/cvsroot/pgsql-server/src/backend/commands/vacuum.c,v
retrieving revision 1.259
diff -c -w -r1.259 vacuum.c
*** backend/commands/vacuum.c   4 Aug 2003 02:39:58 -   1.259
--- backend/commands/vacuum.c   9 Aug 2003 21:17:11 -
***
*** 3109,3118 
  void
  vac_init_rusage(VacRUsage *ru0)
  {
-   struct timezone tz;
- 
getrusage(RUSAGE_SELF, ru0-ru);
!   gettimeofday(ru0-tv, tz);
  }
  
  /*
--- 3109,3116 
  void
  vac_init_rusage(VacRUsage *ru0)
  {
getrusage(RUSAGE_SELF, ru0-ru);
!   gettimeofday(ru0-tv, NULL);
  }
  
  /*
Index: backend/postmaster/postmaster.c
===
RCS file: /projects/cvsroot/pgsql-server/src/backend/postmaster/postmaster.c,v
retrieving revision 1.340
diff -c -w -r1.340 postmaster.c
*** backend/postmaster/postmaster.c 4 Aug 2003 02:40:02 -   1.340
--- backend/postmaster/postmaster.c 9 Aug 2003 21:17:13 -
***
*** 995,1004 
int nSockets;
struct timeval now,
later;
-   struct timezone tz;
int i;
  
!   gettimeofday(now, tz);
  
nSockets = initMasks(readmask);
  
--- 995,1003 
int nSockets;
struct timeval now,
later;
int i;
  
!   gettimeofday(now, NULL);
  
nSockets = initMasks(readmask);
  
***
*** 1080,1086 
 */
while (random_seed == 0)
{
!   gettimeofday(later, tz);
  
/*
 * We are not sure how much precision is in tv_usec, so we
--- 1079,1085 
 */
while (random_seed == 0)
{
!   gettimeofday(later, NULL);
  
/*
 * We are not sure how much precision is in tv_usec, so we
***
*** 2302,2308 
int i;
int status;
struct timeval now;
-   struct timezone tz;
charremote_host[NI_MAXHOST];
charremote_port[NI_MAXSERV];
  
--- 2301,2306 
***
*** 2324,2332 
/* Close the postmaster's other sockets */
ClosePostmasterPorts(true);
  
-   /* Save port etc. for ps status */
-   MyProcPort = port;
- 
/* Reset MyProcPid to new backend's pid */
MyProcPid = getpid();
  
--- 2322,2327 
***
*** 2398,2403 
--- 2393,2405 
elog(FATAL, could not set timer for authorization timeout);
  
/*
+* Save port etc. for ps status 
+* do this after we log connections or auth failures so that we don't use
+* the format line before the details are filled in 
+*/
+   MyProcPort = port;
+ 
+   /*
 * Receive the startup packet (which might turn out to be a cancel
 * request packet).
 */
***
*** 2438,2444 
 * start a new random sequence in the random() library function.
 */
random_seed = 0;
!   gettimeofday(now, tz);
srandom((unsigned int) now.tv_usec);
  
/* 
--- 2440,2446 
 * start a new random sequence in the random() library function.
 */
random_seed = 0;
!   gettimeofday(now, NULL);
srandom((unsigned int) now.tv_usec);
  
/* 
***
*** 2521,2526 
--- 2523,2536 
MemoryContextSwitchTo(TopMemoryContext);
MemoryContextDelete(PostmasterContext);
PostmasterContext = NULL;
+ 
+   /*
+* set up remaining members of port stucture while in the
+* TopMemoryContext
+*/
+   port-remote_host = pstrdup(remote_host);
+   port-remote_port = pstrdup(remote_port);
+   gettimeofday((port-session_start),NULL);
  
/*
 * Debug: print arguments being passed to backend
Index: backend/tcop/postgres.c
===
RCS file: /projects/cvsroot/pgsql-server/src/backend/tcop/postgres.c,v
retrieving revision 1.357
diff -c -w -r1.357