Re: [PATCHES] log_filename_prefix -- log_filename + strftime()
Tom Lane wrote: It's definitely creeping featurism ... but I can see the value of not needing any cron daemon to remove old logs. No other logs on your system to purge? A potential problem is what about size-driven rotation? If the hourly output exceeds log_rotation_size then you'd truncate and rewrite the current file, which is just exactly not what you want :-(. Same can happen after logger process restart. After all, I wonder what an apache style logfile name is good for. The pgsql logfiles don't contain access log data that are analyzed by webalizer or stuff like that. I don't see the point having any formatting option at all. Regards, Andreas ---(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
Re: [PATCHES] log_filename_prefix -- log_filename + strftime()
Andreas Pflug [EMAIL PROTECTED] writes: Tom Lane wrote: I can see the value of not needing any cron daemon to remove old logs. No other logs on your system to purge? The DBA isn't necessarily also root. regards, tom lane ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
Re: [PATCHES] [SQL] array_in: '{}}'::text[]
Tom Lane wrote: actually, why isn't this just a pstrdup? Why not just if (strcmp(str, {}) == 0) Good points. Changes made, and attached committed. Joe Index: src/backend/utils/adt/arrayfuncs.c === RCS file: /cvsroot/pgsql-server/src/backend/utils/adt/arrayfuncs.c,v retrieving revision 1.107 diff -c -r1.107 arrayfuncs.c *** src/backend/utils/adt/arrayfuncs.c 8 Aug 2004 05:01:55 - 1.107 --- src/backend/utils/adt/arrayfuncs.c 28 Aug 2004 19:19:22 - *** *** 183,191 typioparam = my_extra-typioparam; /* Make a modifiable copy of the input */ ! /* XXX why are we allocating an extra 2 bytes here? */ ! string_save = (char *) palloc(strlen(string) + 3); ! strcpy(string_save, string); /* * If the input string starts with dimension info, read and use that. --- 183,189 typioparam = my_extra-typioparam; /* Make a modifiable copy of the input */ ! string_save = pstrdup(string); /* * If the input string starts with dimension info, read and use that. *** *** 375,380 --- 373,379 nelems_last[MAXDIM]; bool scanning_string = false; bool eoArray = false; + bool empty_array = true; char *ptr; ArrayParseState parse_state = ARRAY_NO_LEVEL; *** *** 385,391 } /* special case for an empty array */ ! if (strncmp(str, {}, 2) == 0) return 0; ptr = str; --- 384,390 } /* special case for an empty array */ ! if (strcmp(str, {}) == 0) return 0; ptr = str; *** *** 395,400 --- 394,403 while (!itemdone) { + if (parse_state == ARRAY_ELEM_STARTED || + parse_state == ARRAY_QUOTED_ELEM_STARTED) + empty_array = false; + switch (*ptr) { case '\0': *** *** 481,487 if (parse_state != ARRAY_ELEM_STARTED parse_state != ARRAY_ELEM_COMPLETED parse_state != ARRAY_QUOTED_ELEM_COMPLETED ! parse_state != ARRAY_LEVEL_COMPLETED) ereport(ERROR, (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg(malformed array literal: \%s\, str))); --- 484,491 if (parse_state != ARRAY_ELEM_STARTED parse_state != ARRAY_ELEM_COMPLETED parse_state != ARRAY_QUOTED_ELEM_COMPLETED ! parse_state != ARRAY_LEVEL_COMPLETED ! !(nest_level == 1 parse_state == ARRAY_LEVEL_STARTED)) ereport(ERROR, (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg(malformed array literal: \%s\, str))); *** *** 562,567 --- 566,585 temp[ndim - 1]++; ptr++; } + + /* only whitespace is allowed after the closing brace */ + while (*ptr) + { + if (!isspace(*ptr++)) + ereport(ERROR, + (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), + errmsg(malformed array literal: \%s\, str))); + } + + /* special case for an empty array */ + if (empty_array) + return 0; + for (i = 0; i ndim; ++i) dim[i] = temp[i]; Index: src/test/regress/expected/arrays.out === RCS file: /cvsroot/pgsql-server/src/test/regress/expected/arrays.out,v retrieving revision 1.22 diff -c -r1.22 arrays.out *** src/test/regress/expected/arrays.out 5 Aug 2004 03:30:03 - 1.22 --- src/test/regress/expected/arrays.out 28 Aug 2004 19:19:22 - *** *** 425,427 --- 425,485 t (1 row) + -- + -- General array parser tests + -- + -- none of the following should be accepted + select '{{1,{2}},{2,3}}'::text[]; + ERROR: malformed array literal: {{1,{2}},{2,3}} + select '{{},{}}'::text[]; + ERROR: malformed array literal: {{},{}} + select '{{1,2},\\{2,3}}'::text[]; + ERROR: malformed array literal: {{1,2},\{2,3}} + select '{{1 2 x},{3}}'::text[]; + ERROR: malformed array literal: {{1 2 x},{3}} + select '{}}'::text[]; + ERROR: malformed array literal: {}} + select '{ }}'::text[]; + ERROR: malformed array literal: { }} + -- none of the above should be accepted + -- all of the following should be accepted + select '{}'::text[]; + text + -- + {} + (1 row) + + select '{{{1,2,3,4},{2,3,4,5}},{{3,4,5,6},{4,5,6,7}}}'::text[]; + text + --- + {{{1,2,3,4},{2,3,4,5}},{{3,4,5,6},{4,5,6,7}}} + (1 row) + + select '{0 second ,0 second}'::interval[]; +interval + --- + {@ 0,@ 0} + (1 row) + + select '{ { , } , { 3 } }'::text[]; + text + - + {{,},{3}} + (1 row) + + select ' { {0 second , 0 second } }'::text[]; + text + --- + {{ 0 second ,0 second}} + (1 row) + + select '{ +0 second, +@ 1 hour @ 42 minutes @ 20 seconds + }'::interval[]; + interval +
Re: [PATCHES] [SQL] array_in: '{}}'::text[]
, 28.08.2004, 21:33, Joe Conway : /* special case for an empty array */ ! if (strcmp(str, {}) == 0) return 0; Without looking at the code in a whole, you accept '{} ' as an empty array literal, so why is the special case for '{}' needed here? I should be catched by the code that accepts additional whitespace after the last closing brace, just that there is no white space: + /* only whitespace is allowed after the closing brace */ + while (*ptr) + { + if (!isspace(*ptr++)) + ereport(ERROR, + (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), + errmsg(malformed array literal: \%s\, str))); + } + + /* special case for an empty array */ + if (empty_array) + return 0; Here's the second special case for empty arrays. -- Markus Bertheau [EMAIL PROTECTED] ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings
Re: [PATCHES] Win32 fix: Token buffer
Patch applied. Thanks. --- Magnus Hagander wrote: This patch fixes the open item: o use dynamic buffer for token buffer in win32 admin check //Magnus Content-Description: token_buffer.patch [ Attachment, skipping... ] ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send unregister YourEmailAddressHere to [EMAIL PROTECTED]) -- 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 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
Re: [PATCHES] [pgsql-hackers-win32] Service startup delay
Patch applied. Thanks. --- Dave Page wrote: -Original Message- From: Bruce Momjian [mailto:[EMAIL PROTECTED] Sent: 26 August 2004 02:44 To: Max Dunn Cc: Dave Page; 'Barry Lind'; [EMAIL PROTECTED] Subject: Re: [pgsql-hackers-win32] Service startup delay Another issue is that when installing the Postgres service with pg_ctl register -w the -w parameter was not put in the registry ImagePath value for the Postgres service. (I added it manually to test.) So I suspect that pg_ctl register will need to be enhanced to add the -w parameter to the registry settings. Would a Win32 guy look at this? No problem. Regards, Dave. === RCS file: /projects/cvsroot/pgsql-server/src/bin/pg_ctl/pg_ctl.c,v retrieving revision 1.25 diff -u -r1.25 pg_ctl.c --- pg_ctl.c 21 Aug 2004 03:12:55 - 1.25 +++ pg_ctl.c 26 Aug 2004 14:37:13 - @@ -832,6 +832,9 @@ strcat(cmdLine,\); } + if (do_wait) + strcat(cmdLine, -w); + if (post_opts) { strcat(cmdLine, ); @@ -1038,7 +1041,7 @@ printf(_( %s status [-D DATADIR]\n), progname); printf(_( %s killSIGNALNAME PROCESSID\n), progname); #ifdef WIN32 - printf(_( %s register [-N servicename] [-U username] [-P password] [-D DATADIR] [-o \OPTIONS\]\n), progname); + printf(_( %s register [-N servicename] [-U username] [-P password] [-D DATADIR] [-w] [-o \OPTIONS\]\n), progname); printf(_( %s unregister [-N servicename]\n), progname); #endif printf(_(Common options:\n)); -- 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 8: explain analyze is your friend
Re: [PATCHES] [SQL] array_in: '{}}'::text[]
Markus Bertheau wrote: Without looking at the code in a whole, you accept '{} ' as an empty array literal, so why is the special case for '{}' needed here? It's a fast path for a common special case. Why spend any cycles parsing if we can immediately recognize it? However, anything other than a simple '{}' does require parsing. Joe ---(end of broadcast)--- TIP 8: explain analyze is your friend
Re: [PATCHES] [BUGS] BUG #1219: pgxs does not work fully
Patch applied. Thanks. --- Fabien COELHO wrote: Am Dienstag, 17. August 2004 14:26 schrieb Fabien COELHO: The patch adds missing the libpgport.a file to the installation under install-all-headers. It is needed by some contribs. I install the library in pkglibdir, but I was wondering whether it should be libdir? Yes it should. Please change it. Dear Peter, dear patchers, Please find attached a small patch against current CVS head that fixes pgport library installation so that it goes to libdir instead of pkglibdir. It works for me. Have a nice day, -- Fabien Coelho - [EMAIL PROTECTED] Content-Description: [ Attachment, skipping... ] ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED] -- 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] Service control enhancements
Patch applied. Thanks. --- Dave Page wrote: The attached patch improves pg_ctl's win32 service code to eliminate some possible causes of the stale postmaster.pid problem that some users have reported. - The service did not properly report that it accepts SERVICE_CONTROL_SHUTDOWN events, thus it's possible the SCM simply killed the postmaster on shutdown. - 'WaitHints' are now given to the SCM to prevent it timing out if pg_ctl doesn't respond to a control event quickly enough. - During shutdown, the service checkpoint counter is incremented every five seconds for up to a minute to prevent the SCM timing out and assuming the service is not responding. Please apply. Regards, Dave. Content-Description: pg_ctl.c.diff [ 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 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
Re: [PATCHES] cygwin 8.0.0beta1 postmaster/syslogger.c, port/dirmod.c,
Your patch highlighted several bugs in our code. First, I wasn't testing for CYGWIN in the backend pgport_palloc code. Second, I added an #undef to prevent compiler warnings. Third I added your Cygwin includes with an #ifdef. These will appear in beta2. On the timezone issue, I see this in dt.h: /* Global variable holding time zone information. */ #if !defined(__CYGWIN__) !defined(WIN32) #define TIMEZONE_GLOBAL timezone #else #define TIMEZONE_GLOBAL _timezone #define tzname _tzname /* should be in time.h? */ #endif so are you saying your _timezone is time_t and not an int? Sometimes it is just a short because it is only minutes west of GMT, not an actually seconds since 1970 or anything. Making it time_t actually sounds like overkill, but we can work around that in dt.h if indeed that is how your OS defines it. The easiest fix would probably be to add the cast to int right in dt.h and only for Cygwin: #define TIMEZONE_GLOBAL ((int)_timezone) Does that work for you? --- Reini Urban wrote: Attached patches are required for cygwin: 2004-08-24 21:23:53 [EMAIL PROTECTED] * (postmaster/syslogger.c) struct timeval is declared in sys/time.h, not in time.h 2004-08-24 20:20:54 rurban: * (port/dirmod.c) cygwin needs different header locations, and unlink is a macro. There are no pgport_palloc versions yet timezone/pgtz.c: Pending is a patch against postgresql-8.0.0beta1/config/c-library.m4: PGAC_VAR_INT_TIMEZONE In the meantime I've hacked it with a cast from time_t to (int) in timezone/pgtz.c: get_timezone_offset but timezone really is of time_t, not int. I don't know what you are trying to do here. There's on remaining issue for the cygwin build: ../../src/port/libpgport.a(dirmod.o)(.text+0x5ee):dirmod.c: undefined reference to `__imp__CurrentMemoryContext' ../../src/port/libpgport.a(dirmod.o)(.text+0x64b):dirmod.c: undefined reference to `__imp__CurrentMemoryContext' which explains the pgport_palloc problem. -- Reini Urban http://xarch.tu-graz.ac.at/home/rurban/ 2004-08-24 20:20:54 rurban: * cygwin needs different header locations, and unlink is a macro * There are no pgport_palloc versions yet --- postgresql-8.0.0beta1/src/port/dirmod.c.orig 2004-08-08 07:44:36.0 +0100 +++ postgresql-8.0.0beta1/src/port/dirmod.c 2004-08-24 19:20:56.557435000 +0100 @@ -33,16 +33,28 @@ #include miscadmin.h + +#ifdef __CYGWIN__ +#include windows.h +#include w32api/winioctl.h +#else #include winioctl.h +#undef unlink +#endif #undef rename -#undef unlink +/* 2004-08-24 20:20:54 rurban: There are no pgport_palloc versions yet */ +#if 0 #ifndef FRONTEND +#undef palloc +#undef pstrdup +#undef pfree #define palloc(sz) pgport_palloc(sz) #define pstrdup(str) pgport_pstrdup(str) #define pfree(pointer) pgport_pfree(pointer) #endif +#endif /* 2004-08-24 21:23:53 [EMAIL PROTECTED] * struct timeval is declared in sys/time.h, not in time.h --- postgresql-8.0.0beta1/src/backend/postmaster/syslogger.c.orig 2004-08-06 20:17:31.0 +0100 +++ postgresql-8.0.0beta1/src/backend/postmaster/syslogger.c 2004-08-24 20:21:26.057851800 +0100 @@ -28,6 +28,7 @@ #include signal.h #include time.h #include unistd.h +#include sys/time.h #include sys/stat.h #include libpq/pqsignal.h --- postgresql-8.0.0beta1/src/timezone/pgtz.c.orig2004-07-31 20:12:15.0 +0100 +++ postgresql-8.0.0beta1/src/timezone/pgtz.c 2004-08-24 19:56:30.686367800 +0100 @@ -97,9 +97,9 @@ return tm-tm_gmtoff; #elif defined(HAVE_INT_TIMEZONE) #ifdef HAVE_UNDERSCORE_TIMEZONE - return -_timezone; + return -(int)_timezone; #else - return -timezone; + return -(int)timezone; #endif #else #error No way to determine TZ? Can this happen? ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match -- 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 Index: src/backend/utils/mmgr/mcxt.c === RCS file: /cvsroot/pgsql-server/src/backend/utils/mmgr/mcxt.c,v retrieving revision 1.47 diff -c -c -r1.47 mcxt.c *** src/backend/utils/mmgr/mcxt.c 8 Aug 2004 06:44:32 - 1.47 --- src/backend/utils/mmgr/mcxt.c 29 Aug 2004 02:50:25 - *** *** 631,637 } ! #ifdef WIN32 /* *Memory support routines for libpgport on
Re: [PATCHES] add hint
Patch applied. Thanks. --- James William Pye wrote: -- Start of PGP signed section. On Wed, 2004-08-25 at 13:11, Tom Lane wrote: It'd be even better if it followed the message style guidelines... Indeed. I was unaware of the guidelines, but remedied that after a quick google. http://www.postgresql.org/docs/current/static/error-style-guide.html I assume the problem was only with the lack of capitalization and ending punctuation(as hints and details are specified to have). -- Regards, James William Pye [ Attachment, skipping... ] -- End of PGP section, PGP failed! -- 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 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Re: [PATCHES] log_line_prefix additions
This has been saved for the 8.1 release: http:/momjian.postgresql.org/cgi-bin/pgpatches2 --- Ed L. wrote: This patch against 8.0.0beta1 source adds log_line_prefix options for millisecond timestamps (%m), remote host (%h), and remote port (%P). The milliseconds are useful for QPS measurements, and the remote port is worthless to us as part of %r. [ Attachment, skipping... ] [ Attachment, skipping... ] ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html -- 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 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
Re: [PATCHES] Win32 bug fix
Patch applied. Thanks. --- Claudio Natoli wrote: Could someone please eyeball the attached patch for errors and as a correction for: http://archives.postgresql.org/pgsql-bugs/2004-08/msg00307.php Also, could someone (Maksim?) please reproduce the bug on their system, and then confirm that the patch corrects (as I seem unable to reproduce the bug, which in itself is a mystery I don't have time to solve :-) Cheers, Claudio --- Certain disclaimers and policies apply to all email sent from Memetrics. For the full text of these disclaimers and policies see a href=http://www.memetrics.com/emailpolicy.html;http://www.memetrics.com/em ailpolicy.html/a [ Attachment, skipping... ] ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match -- 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 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
Re: [PATCHES] log_filename_prefix -- log_filename + strftime()
Are we going to change this before beta2? I have not seen a final patch yet. --- Ed L. wrote: Attached is a patch which replaces the 'log_filename_prefix' configuration directive with a similar 'log_filename' directive. It differs from the former in the following ways: + allows embedded strftime() escapes ala Apache's rotatelogs; + eliminates hard-coded embedding of the postmaster pid; + makes the current hard-coded timestamp configurable; + changes the default log filename to exclude the PID; This patch enables us to continue using our existing log-handling utilities and filenaming conventions which we now use with Apache's rotatelogs. [ Attachment, skipping... ] ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org -- 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 8: explain analyze is your friend