Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > d3c4bfd951c25dab3d8c83571c73f957 > files > 32

postgresql-8.1.23-10.el5_10.src.rpm

PostgreSQL includes its own copy of the zic timezone database, which is great
for ensuring portable results but not so great from a package maintenance
perspective.  Since the data is in the same format as is provided by the
Linux-standard /usr/share/zoneinfo files, we can avoid having to update
postgresql for timezone updates by just using those files instead.

Note: as of PG 8.3 this patch will be unnecessary; use configure's
--with-system-tzdata switch instead.


diff -Naur postgresql-8.1.11.orig/src/timezone/Makefile postgresql-8.1.11/src/timezone/Makefile
--- postgresql-8.1.11.orig/src/timezone/Makefile	2007-03-14 13:38:22.000000000 -0400
+++ postgresql-8.1.11/src/timezone/Makefile	2008-01-04 12:11:50.000000000 -0500
@@ -38,7 +38,6 @@
 	$(CC) $(CFLAGS) $(ZICOBJS) $(LDFLAGS) $(LIBS) -o $@$(X)
 
 install: all installdirs
-	./zic -d $(DESTDIR)$(datadir)/timezone -p $(POSIXRULES) $(TZDATAFILES)
 
 installdirs:
 	$(mkinstalldirs) $(DESTDIR)$(datadir)
diff -Naur postgresql-8.1.11.orig/src/timezone/pgtz.c postgresql-8.1.11/src/timezone/pgtz.c
--- postgresql-8.1.11.orig/src/timezone/pgtz.c	2005-11-22 13:23:31.000000000 -0500
+++ postgresql-8.1.11/src/timezone/pgtz.c	2008-01-04 12:10:36.000000000 -0500
@@ -32,9 +32,6 @@
 pg_tz	   *global_timezone = NULL;
 
 
-static char tzdir[MAXPGPATH];
-static int	done_tzdir = 0;
-
 static const char *identify_system_timezone(void);
 static const char *select_default_timezone(void);
 static bool set_global_timezone(const char *tzname);
@@ -46,14 +43,7 @@
 char *
 pg_TZDIR(void)
 {
-	if (done_tzdir)
-		return tzdir;
-
-	get_share_path(my_exec_path, tzdir);
-	strcat(tzdir, "/timezone");
-
-	done_tzdir = 1;
-	return tzdir;
+	return "/usr/share/zoneinfo";
 }