Re: [PATCHES] cast pid_t to int when using *printf
Bruce Momjian wrote: I see in include/sys/types.h on Solaris 9: #if defined(_LP64) || defined(_I32LPx) typedef uint_t nlink_t; /* file link type */ typedef int pid_t; /* process id type */ #else typedef ulong_t nlink_t;/* (historical version) */ typedef longpid_t; /* (historical version) */ #endif I am confused why you are seeing long for pid_t? What is your Solaris system information? If Solaris needs adjustments, there are a lot of place we print getpid(). This is also what is on the Solaris system I was using. gcc -E showed that the #else branch was being taken. The #if branch is taken when compiling in 64-bit mode (gcc -m64). We're fine so long as everything casts to either int or long. I only saw warnings from a couple of places that did not do a cast at all. -O ---(end of broadcast)--- TIP 8: explain analyze is your friend
[PATCHES] (Turkish) New translation: pg_resetxlog, Updated translation: pg_ctl
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, I've fully translated pg_resetxlog into Turkish (new translation). It's below: http://www.gunduz.org/postgresql/translation/PostgreSQL-8.0/pg_resetxlog-tr.pot Also, updated pg_ctl translation to 100% : http://www.gunduz.org/postgresql/translation/PostgreSQL-8.0/pg_ctl-tr.pot Could you please apply them for 8.0? BTW, on http://developer.postgresql.org/~petere/nlsstatus/#tcurrent , Turkish translation of pg_controldata seems 95%, but on my side: $ msgfmt -o /dev/null -v -c pg_controldata-tr.pot 41 translated messages. It should be 100%, IMHO. Regards, - -- Devrim GUNDUZ devrim~gunduz.orgdevrim.gunduz~linux.org.tr http://www.tdmsoft.com http://www.gunduz.org -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFBZ7Z6tl86P3SPfQ4RAuGwAJ0S5/L6+tn5gAzkahOBHDclHXfARwCgxmcZ 5g6YlC0pPnZF+MFe1z1Oy5k= =zJaV -END PGP SIGNATURE- ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
[PATCHES] minor code cleanup
The attached patch makes the following cosmetic improvements: - replace some function signatures of the form some_type foo() with some_type foo(void) - replace a few instances of a literal 0 being used as a NULL pointer; there are more instances of this in the code, but I just fixed a few - in src/backend/utils/mb/wstrncmp.c, replace KR style function declarations with ANSI style, remove use of 'register' keyword - remove an extern modifier that was applied to a function definition (rather than a declaration) (These changes were made initially to satisfy sparse, but IMHO they are all good style anyway.) Barring any objections, I intend to apply this patch on Sunday or Monday. -Neil Index: src/backend/bootstrap/bootparse.y === RCS file: /var/lib/cvs/pgsql-server/src/backend/bootstrap/bootparse.y,v retrieving revision 1.73 diff -c -r1.73 bootparse.y *** src/backend/bootstrap/bootparse.y 31 Aug 2004 17:10:36 - 1.73 --- src/backend/bootstrap/bootparse.y 9 Oct 2004 10:10:11 - *** *** 52,58 static void ! do_start() { StartTransactionCommand(); elog(DEBUG4, start transaction); --- 52,58 static void ! do_start(void) { StartTransactionCommand(); elog(DEBUG4, start transaction); *** *** 60,66 static void ! do_end() { CommitTransactionCommand(); elog(DEBUG4, commit transaction); --- 60,66 static void ! do_end(void) { CommitTransactionCommand(); elog(DEBUG4, commit transaction); Index: src/backend/bootstrap/bootstrap.c === RCS file: /var/lib/cvs/pgsql-server/src/backend/bootstrap/bootstrap.c,v retrieving revision 1.194 diff -c -r1.194 bootstrap.c *** src/backend/bootstrap/bootstrap.c 8 Oct 2004 01:36:33 - 1.194 --- src/backend/bootstrap/bootstrap.c 9 Oct 2004 10:14:26 - *** *** 1012,1018 len = strlen(str); ! node = FindStr(str, len, 0); if (node) return node-strnum; else --- 1012,1018 len = strlen(str); ! node = FindStr(str, len, NULL); if (node) return node-strnum; else Index: src/backend/utils/mb/wstrncmp.c === RCS file: /var/lib/cvs/pgsql-server/src/backend/utils/mb/wstrncmp.c,v retrieving revision 1.6 diff -c -r1.6 wstrncmp.c *** src/backend/utils/mb/wstrncmp.c 25 Mar 2001 23:23:59 - 1.6 --- src/backend/utils/mb/wstrncmp.c 9 Oct 2004 10:47:52 - *** *** 38,47 #include mb/pg_wchar.h int ! pg_wchar_strncmp(s1, s2, n) ! register const pg_wchar *s1, ! *s2; ! register size_t n; { if (n == 0) return 0; --- 38,44 #include mb/pg_wchar.h int ! pg_wchar_strncmp(const pg_wchar *s1, const pg_wchar *s2, size_t n) { if (n == 0) return 0; *** *** 56,65 } int ! pg_char_and_wchar_strncmp(s1, s2, n) ! register const char *s1; ! register const pg_wchar *s2; ! register size_t n; { if (n == 0) return 0; --- 53,59 } int ! pg_char_and_wchar_strncmp(const char *s1, const pg_wchar *s2, size_t n) { if (n == 0) return 0; *** *** 74,83 } size_t ! pg_wchar_strlen(str) ! const pg_wchar *str; { ! register const pg_wchar *s; for (s = str; *s; ++s) ; --- 68,76 } size_t ! pg_wchar_strlen(const pg_wchar *str) { ! const pg_wchar *s; for (s = str; *s; ++s) ; Index: src/backend/utils/misc/guc.c === RCS file: /var/lib/cvs/pgsql-server/src/backend/utils/misc/guc.c,v retrieving revision 1.240 diff -c -r1.240 guc.c *** src/backend/utils/misc/guc.c8 Oct 2004 01:36:35 - 1.240 --- src/backend/utils/misc/guc.c9 Oct 2004 10:49:53 - *** *** 4318,4324 define_custom_variable(var-gen); } ! extern void EmitWarningsOnPlaceholders(const char *className) { struct config_generic **vars = guc_variables; --- 4318,4324 define_custom_variable(var-gen); } ! void EmitWarningsOnPlaceholders(const char *className) { struct config_generic **vars = guc_variables; Index: src/bin/initdb/initdb.c === RCS file: /var/lib/cvs/pgsql-server/src/bin/initdb/initdb.c,v retrieving revision 1.59 diff -c -r1.59 initdb.c *** src/bin/initdb/initdb.c 7 Oct 2004 18:57:26 - 1.59 --- src/bin/initdb/initdb.c 9 Oct 2004 10:56:04 - *** *** 1881,1887 * call exit_nicely() if we got a signal, or else output ok. */ static
[PATCHES] cypg.dll, libpq_a, initdb max_connections 60
1. cyg-pgdll.patch For the cygwin port I found out that we'd need a better name for libpq libraries only, and that the name pq.dll is not a good one. It would clash with the mingw version, which might get copied into the path. We have out own standards, esp. when dealing with import libs, which would require the cyg prefix for pq.dll. I also did't find the version-info linker switches, though I found some discussion that it should be used. Even WIN32 has versioning now via the .rc. So added them for our port. You might want that also for all gnu gcc ports. This patch is for src/bin/pg_ctl/Makefile only. With this patch we might want to rename libpq.a to libpq.dll.a in our install step later. 2. cyg-pgdll+libpq_a.patch Rename to libpq.dll.a and cygpq.dll. The former patch is not needed then. Reason: We have some magic dealing with -lpq, which picks up /usr/lib/libpq.dll.a automatically. Esp. libtool is not very clever, when trying to use old-style libpq.a name. This patch has to deal with the $(libpq_builddir)/libpq.a dependency in src/bin/*/Makefile and src/interfaces/libpq/Makefile. It also changes the linker line to always pick up our current libpq.a instead of -L$(libpq_builddir) -lpq. This is not a must for cygwin. cyg-pgdll.patch would be enough. It is also not perfect: Because of some overriding (have to study info make) it recompiles cygpg.dll and libpg.dll.a for every client target. PS: I personally would vastly prefer libtool. The .la files will help immensily in testing and installing. But this is only an issue for libpg, and probably not worth the effort. 3. cyg-initdb.patch limit initdb max_connections for cygwin. cygwin has a hard-coded limit of max 63 subprocesses in cygwin1.dll. So 100 is not a good value to start with. I've set that to 60. http://archives.postgresql.org/pgsql-cygwin/2002-09/msg2.php Fixing src/backend/utils/misc/postgresql.conf.sample would be stupid. -- Reini Urban http://xarch.tu-graz.ac.at/home/rurban/ *** postgresql-8.0.0cvs/src/interfaces/libpq/Makefile.orig Sun Sep 26 04:14:47 2004 --- postgresql-8.0.0cvs/src/interfaces/libpq/Makefile Sat Oct 9 15:17:01 2004 *** *** 27,32 --- 27,36 dllist.o md5.o ip.o wchar.o encnames.o noblock.o pgstrcasecmp.o thread.o \ $(filter crypt.o getaddrinfo.o inet_aton.o open.o snprintf.o strerror.o, $(LIBOBJS)) + ifeq ($(PORTNAME), cygwin) + override shlib = cyg$(NAME)$(DLSUFFIX) + endif + ifeq ($(PORTNAME), win32) OBJS+=win32.o libpqrc.o libpqrc.o: libpq.rc *** *** 54,59 --- 58,70 include $(top_srcdir)/src/Makefile.shlib backend_src = $(top_srcdir)/src/backend + ifeq ($(PORTNAME), cygwin) + $(shlib) lib$(NAME).dll.a: $(OBJS) $(DLLINIT) + $(DLLTOOL) --export-all $(DLLTOOL_DEFFLAGS) --dllname $(shlib) --output-def $(NAME).def $(OBJS) + $(DLLWRAP) -Wl,--major-image-version,$(SO_MAJOR_VERSION) -Wl,--minor-image-version,$(SO_MINOR_VERSION) \ + -o $(shlib) --dllname $(shlib) $(DLLWRAP_FLAGS) --def $(NAME).def $(OBJS) $(DLLINIT) $(SHLIB_LINK) + $(DLLTOOL) --dllname $(shlib) $(DLLTOOL_LIBFLAGS) --def $(NAME).def --output-lib lib$(NAME).a + endif # We use several backend modules verbatim, but since we need to # compile with appropriate options to build a shared lib, we can't --- postgresql-8.0.0cvs/src/Makefile.global.orig2004-10-07 04:46:04.409784800 +0200 +++ postgresql-8.0.0cvs/src/Makefile.global 2004-10-09 14:46:47.034467200 +0200 @@ -302,6 +302,11 @@ endif libpq = -L$(libpq_builddir) -lpq +ifeq ($(PORTNAME), cygwin) +libpq_a= $(libpq_builddir)/libpq.dll.a +else +libpq_a = $(libpq_builddir)/libpq.a +endif submake-libpq: $(MAKE) -C $(libpq_builddir) all --- postgresql-8.0.0cvs/src/bin/initdb/Makefile.orig2004-08-29 06:13:01.0 +0200 +++ postgresql-8.0.0cvs/src/bin/initdb/Makefile 2004-10-09 14:29:31.766468800 +0200 @@ -19,8 +19,8 @@ all: submake-libpq submake-libpgport initdb -initdb: $(OBJS) $(libpq_builddir)/libpq.a - $(CC) $(CFLAGS) $(OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o [EMAIL PROTECTED](X) +initdb: $(OBJS) $(libpq_a) + $(CC) $(CFLAGS) $(OBJS) $(libpq_a) $(LDFLAGS) $(LIBS) -o [EMAIL PROTECTED](X) dirmod.c: % : $(top_srcdir)/src/port/% rm -f $@ $(LN_S) $ . --- postgresql-8.0.0cvs/src/interfaces/libpq/Makefile.orig 2004-09-26 04:14:47.0 +0200 +++ postgresql-8.0.0cvs/src/interfaces/libpq/Makefile 2004-10-09 14:52:14.827146400 +0200 @@ -27,6 +27,10 @@ dllist.o md5.o ip.o wchar.o encnames.o noblock.o pgstrcasecmp.o thread.o \ $(filter crypt.o getaddrinfo.o inet_aton.o open.o snprintf.o strerror.o, $(LIBOBJS)) +ifeq ($(PORTNAME), cygwin) +override shlib = cyg$(NAME)$(DLSUFFIX) +endif + ifeq ($(PORTNAME), win32) OBJS+=win32.o libpqrc.o libpqrc.o: libpq.rc @@ -54,6 +58,13 @@ include $(top_srcdir)/src/Makefile.shlib backend_src = $(top_srcdir)/src/backend +ifeq ($(PORTNAME), cygwin)
Re: [PATCHES] cypg.dll, libpq_a, initdb max_connections 60
Reini Urban [EMAIL PROTECTED] writes: With this patch we might want to rename libpq.a to libpq.dll.a in our install step later. Isn't .dll.a a contradiction in terms? This doesn't seem well-thought-out at all to me. Also the end result would have to be much more invasive than you suggest here, since there are many more programs besides pg_ctl that use libpq. + #ifdef __CYGWIN__ + static const int conns[] = {60, 50, 40, 30, 20, 10, 5}; + #else static const int conns[] = {100, 50, 40, 30, 20, 10}; + #endif This part is just silly. If your system can't support ten connections I think you need to fix your system. Also, we are not in the habit of plastering the source with platform-specific ifdefs just to save a couple of cycles during initialization. If the probe at 100 caused an actual failure on cygwin, I'd accept such a patch, but not otherwise. How legible do you think this code would be if we tried to #ifdef in platform-specific limits for every port we support? regards, tom lane ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send unregister YourEmailAddressHere to [EMAIL PROTECTED])
Re: [PATCHES] cypg.dll, libpq_a, initdb max_connections 60
Tom Lane schrieb: Reini Urban [EMAIL PROTECTED] writes: With this patch we might want to rename libpq.a to libpq.dll.a in our install step later. Isn't .dll.a a contradiction in terms? This doesn't seem well-thought-out at all to me. Also the end result would have to be much more invasive than you suggest here, since there are many more programs besides pg_ctl that use libpq. .dll.a: well, that's the fact. I had terrible problems in compiling apps which link to libpq.a, which actually is libtool problem. it's has very very low urgency. invasiveness: see the libpq_a patch. I wonder why you link all clients statically. with a libpq macro you could decide to which version (shared or static) you want to link against. + #ifdef __CYGWIN__ + static const int conns[] = {60, 50, 40, 30, 20, 10, 5}; + #else static const int conns[] = {100, 50, 40, 30, 20, 10}; + #endif This part is just silly. If your system can't support ten connections I think you need to fix your system. Also, we are not in the habit of plastering the source with platform-specific ifdefs just to save a couple of cycles during initialization. If the probe at 100 caused an actual failure on cygwin, I'd accept such a patch, but not otherwise. How legible do you think this code would be if we tried to #ifdef in platform-specific limits for every port we support? arguments accepted. though the probe for cygwin at 100 causes it NOT to fail. this is actually a more severe problem. It'll stay in my private patches archive. -- Reini Urban http://xarch.tu-graz.ac.at/home/rurban/ ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html
Re: [PATCHES] cypg.dll, libpq_a, initdb max_connections 60
1. cyg-pgdll.patch For the cygwin port I found out that we'd need a better name for libpq libraries only, and that the name pq.dll is not a good one. It would clash with the mingw version, which might get copied into the path. We have out own standards, esp. when dealing with import libs, which would require the cyg prefix for pq.dll. The mingw library is libpq.dll, not pq.dll. If cygwin uses just pq.dll there will be no clash. Same for the native win32 version, which has been around for years. //Magnus ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org