Please apply the following patch to fix problems with the AIX port
authorBruce Momjian
Fri, 29 Sep 2000 22:00:49 +0000 (22:00 +0000)
committerBruce Momjian
Fri, 29 Sep 2000 22:00:49 +0000 (22:00 +0000)
and the fmgr redesign.

It makes the homebrewn dl*() functions for more recent Versions of AIX
obsolete
by using the system dl*() functions instead.

It also fixes the expected file for the horology regression test.
Please regenerate configure from configure.in, I don't have the
environment/time.

Andreas

configure.in
src/backend/port/aix/mkldexport.sh
src/backend/port/dynloader/aix.c
src/backend/port/dynloader/aix.h
src/include/config.h.in
src/makefiles/Makefile.aix
src/test/regress/expected/horology-1947-PDT.out

index 2ea1b3c63e2c11d12375b08fff4f891d1677b3ec..51230d9e22062318af60b053be56074be94fee5c 100644 (file)
@@ -716,7 +716,7 @@ fcntl(0, F_SETLK, &lck);],
         ;;
 esac
 
-AC_CHECK_FUNCS([fcvt getopt_long memmove pstat setproctitle setsid sigprocmask sysconf waitpid])
+AC_CHECK_FUNCS([fcvt getopt_long memmove pstat setproctitle setsid sigprocmask sysconf waitpid dlopen])
 
 AC_CACHE_CHECK([for PS_STRINGS], [pgac_cv_var_PS_STRINGS],
 [AC_TRY_LINK(
index 4a42a9729c82eed92de79a574a7abb9cde8079b2..4e6c98541defb92c1f0640a20be4fb01e44c30a0 100755 (executable)
@@ -43,7 +43,12 @@ fi
 if [ -z "$2" ]; then
    echo '#!'
 else
-   echo '#!' $2/$OBJNAME
+   if [ "$2" = "." ]; then
+       # for the base executable (AIX 4.2 and up)
+       echo '#! .'
+   else
+       echo '#!' $2/$OBJNAME
+   fi
 fi
 $NM -Bg $1 | \
    egrep ' [TDB] ' | \
index c6295406e2273ea3ff1cef5af7b6193a024c5c69..c1556bb1c20f73c2357c2a423ada673efcddf83f 100644 (file)
 #include "postgres.h"
 #include "dynloader.h"
 
+#ifndef HAVE_DLOPEN
+
+/*
+ * AIX 4.3 and up has dlopen() and friends in -ldl.
+ * A la long, the homebrewn dl*() functions below should be obsolete.
+ */
+
 /*
  * We simulate dlopen() et al. through a call to load. Because AIX has
  * no call to find an exported symbol we read the loader section of the
@@ -601,3 +608,5 @@ findMain(void)
    free(buf);
    return ret;
 }
+
+#endif /* HAVE_DLOPEN */
index ee19b47ea45c1b0115bc5848faf45f2f817d9795..35b3a0d0aa21d23a0ab7dc7cd69bb721c4a7e586 100644 (file)
@@ -1,13 +1,19 @@
 /*
- * $Id: aix.h,v 1.2 1998/09/01 04:30:51 momjian Exp $
+ * $Id: aix.h,v 1.3 2000/09/29 22:00:43 momjian Exp $
  *
  * @(#)dlfcn.h 1.4 revision of 95/04/25  09:36:52
  * This is an unpublished work copyright (c) 1992 HELIOS Software GmbH
  * 30159 Hannover, Germany
  */
 
-#ifndef __dlfcn_h__
-#define __dlfcn_h__
+#ifndef PORT_PROTOS_H
+#define PORT_PROTOS_H
+
+#ifdef HAVE_DLOPEN
+
+#include 
+
+#else /* HAVE_DLOPEN */
 
 #ifdef __cplusplus
 extern     "C"
@@ -48,9 +54,14 @@ extern       "C"
 
 #endif
 
-#define  pg_dlopen(f)  dlopen(filename, RTLD_LAZY)
-#define  pg_dlsym(h,f) dlsym(h, f)
-#define  pg_dlclose(h) dlclose(h)
-#define  pg_dlerror()  dlerror()
+#endif /* HAVE_DLOPEN */
+
+#include "fmgr.h"
+#include "utils/dynamic_loader.h"
+
+#define  pg_dlopen(f)  dlopen(f, RTLD_LAZY)
+#define  pg_dlsym  dlsym
+#define  pg_dlclose    dlclose
+#define  pg_dlerror    dlerror
 
-#endif  /* __dlfcn_h__ */
+#endif  /* PORT_PROTOS_H */
index 05228d18ba0579f119d72f8bd44cea64e9fa5dd6..c363bceb4ca1ab69001a6ba7b8837e4dad1cf77a 100644 (file)
@@ -8,7 +8,7 @@
  * or in config.h afterwards.  Of course, if you edit config.h, then your
  * changes will be overwritten the next time you run configure.
  *
- * $Id: config.h.in,v 1.136 2000/09/29 13:53:32 petere Exp $
+ * $Id: config.h.in,v 1.137 2000/09/29 22:00:45 momjian Exp $
  */
 
 #ifndef CONFIG_H
@@ -581,6 +581,9 @@ extern void srandom(unsigned int seed);
 /* Define if C++ compiler accepts "#include " */
 #undef HAVE_CXX_STRING_HEADER
 
+/* Define if a system lib (-ldl) has dlopen() (needed for AIX) */
+#undef HAVE_DLOPEN
+
 
 /*
  *------------------------------------------------------------------------
index 0066135179e8c34aeebccc05f7fe0a96edc14bd7..c40ff6d374cd84dffec5f78b393341170c31e94f 100644 (file)
@@ -22,4 +22,4 @@ $(POSTGRES_IMP):
 
 %$(DLSUFFIX): %.o %$(EXPSUFF)
    @echo Making share library $@ from $*.o, $*$(EXPSUFF), and installed postgres.imp
-   $(LD) -H512 -bM:SRE -bI:$(libdir)/$(POSTGRES_IMP) -bE:$*$(EXPSUFF) -o $@ $*.o $(LDFLAGS) $(CFLAGS_SL)
+   $(CC) -Wl,-H512 -Wl,-bM:SRE -Wl,-bI:$(libdir)/$(POSTGRES_IMP) -Wl,-bE:$*$(EXPSUFF) -o $@ $*.o $(LDFLAGS) $(CFLAGS_SL)
index b04f877b870ef9711b8791714c966d7a2b571997..b467286bca3385ca99367313a91cdf2a2f3d3e09 100644 (file)
@@ -2,6 +2,48 @@
 -- HOROLOGY
 --
 --
+-- date, time arithmetic
+--
+SELECT date '1981-02-03' + time '04:05:06' AS "Date + Time";
+         Date + Time          
+------------------------------
+ Tue Feb 03 04:05:06 1981 PST
+(1 row)
+
+SELECT date '1991-02-03' + time with time zone '04:05:06 PST' AS "Date + Time PST";
+       Date + Time PST        
+------------------------------
+ Sun Feb 03 04:05:06 1991 PST
+(1 row)
+
+SELECT date '2001-02-03' + time with time zone '04:05:06 UTC' AS "Date + Time UTC";
+       Date + Time UTC        
+------------------------------
+ Fri Feb 02 20:05:06 2001 PST
+(1 row)
+
+SELECT date '1991-02-03' + interval '2 years' AS "Add Two Years";
+        Add Two Years         
+------------------------------
+ Wed Feb 03 00:00:00 1993 PST
+(1 row)
+
+SELECT date '2001-12-13' - interval '2 years' AS "Subtract Two Years";
+      Subtract Two Years      
+------------------------------
+ Mon Dec 13 00:00:00 1999 PST
+(1 row)
+
+SELECT date '1991-02-03' - time '04:05:06' AS "Subtract Time";
+        Subtract Time         
+------------------------------
+ Sat Feb 02 19:54:54 1991 PST
+(1 row)
+
+SELECT date '1991-02-03' - time with time zone '04:05:06 UTC' AS "Subtract Time UTC";
+ERROR:  Unable to identify an operator '-' for types 'date' and 'timetz'
+   You will have to retype this query using an explicit cast
+--
 -- timestamp, interval arithmetic
 --
 SELECT timestamp '1996-03-01' - interval '1 second' AS "Feb 29";