[PATCHES] document rep; no black magic
This patch adds a comment that describes what the rep; no sequence in spin_delay() does, in src/include/storage/s_lock.h. I think fully describing what this code sequence is intended to due is worth the space, but speak up if you think I've added too large a comment... Barring any objections, I intend to apply this tomorrow. -Neil Index: src/include/storage/s_lock.h === RCS file: /home/neilc/private-cvsroot/pgsql-server/src/include/storage/s_lock.h,v retrieving revision 1.131 diff -c -r1.131 s_lock.h *** src/include/storage/s_lock.h 24 Sep 2004 01:48:43 - 1.131 --- src/include/storage/s_lock.h 6 Oct 2004 06:48:42 - *** *** 138,143 --- 138,166 static __inline__ void spin_delay(void) { + /* + * This sequence is equivalent to the PAUSE instruction (rep is + * ignored by old IA32 processors if the following instruction is + * not a string operation); the IA-32 Architecture Software + * Developer's Manual, Vol. 3, Section 7.7.2 describes why using + * PAUSE in the inner loop of a spin lock is necessary for good + * performance: + * + * The PAUSE instruction improves the performance of IA-32 + * processors supporting Hyper-Threading Technology when + * executing spin-wait loops and other routines where one + * thread is accessing a shared lock or semaphore in a tight + * polling loop. When executing a spin-wait loop, the + * processor can suffer a severe performance penalty when + * exiting the loop because it detects a possible memory order + * violation and flushes the core processor's pipeline. The + * PAUSE instruction provides a hint to the processor that the + * code sequence is a spin-wait loop. The processor uses this + * hint to avoid the memory order violation and prevent the + * pipeline flush. In addition, the PAUSE instruction + * de-pipelines the spin-wait loop to prevent it from + * consuming execution resources excessively. + */ __asm__ __volatile__( rep; nop \n); } ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html
Re: [PATCHES] Quieting the copyright/startup message...
On Tue, 2004-10-05 at 10:32, Neil Conway wrote: I think the second hunk (arranging to read ~/.psqlrc before emitting the copyright message) is all that's necessary [...] Patch applied. -Neil ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html
Re: [PATCHES] pgxs default installation + various fixes - v2
Patch applied. Thanks. --- Fabien COELHO wrote: Dear patchers, please find attached an alternate submission which addresses open item make pgxs install by default. It is up to the committers to chose. (1) there is only one install target. no more install-all-headers. it simplifies/changes several makefiles. (2) the documentation reflects the change. (3) a minor fix on pgxs to use a nicer patch without a double slash. I'm available to fix any issue with this patch. A possible improvement wrt pgxs, maybe not mandatory for 8.0, would be to allow regression tests, but again I'm not sure about what is needed and what are the implications. I have to investigate, and I don't have much time right now... Have a nice day, -- Fabien Coelho - [EMAIL PROTECTED] Content-Description: [ Attachment, skipping... ] ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster -- 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 2: you can get off all lists at once with the unregister command (send unregister YourEmailAddressHere to [EMAIL PROTECTED])
Re: [PATCHES] pg_hba.conf additional comment re local line
Patch applied. Thanks. I adjusted the code slightly and I tested !HAVE_UNIX_SOCKETS rather than Win32. --- Andrew Dunstan wrote: The original of this seems to have gotten lost in the ether somewhere. It might turn up some day ... andrew Tom Lane wrote: Andrew Dunstan [EMAIL PROTECTED] writes: The attached tiny patch will possibly help to avoid some confusion by Windows users about the local line in pg_hba.conf (and thus help reduce queries to us ;-) ). I was wondering if we could teach initdb to remove that line altogether in Windows installations. I think this does what Tom and Peter suggested. I don't have a Windows box to test it on, though. cheers andrew ---(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] plpython win32
Patch applied. Thanks. --- Magnus Hagander wrote: So, here is a new patch. Summary: There is still a hard-coded python version in libpython23.a. Argh. I thought I caught them all. How the heck did I miss such an obvious one. Of cuorse, it's supposed to be libpython${pytverstr}.a... Same for the .def file on the next line. Here is an updated patch that fixes this. Apart from that, same as before. //Magnus Content-Description: plpython_win32.patch [ Attachment, skipping... ] ---(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 -- 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] SSL on win32
Patch applied. Thanks. --- Magnus Hagander wrote: Hello! Here is a patch to fix win32 ssl builds. Summary of changes: * Links with -leay32 and -lssleay32 instead of crypto and ssl. On win32, crypto and ssl is only used for static linking. * Initializes SSL in the backend and not just in the postmaster. We cannot pass the SSL context from the postmaster through the parameter file, because it contains function pointers. * Split one error check in be-secure.c. Previously we could not tell which of three calls actually failed. The previous code also returned incorrect error messages if SSL_accept() failed - that function needs to use SSL_get_error() on the return value, can't just use the error queue. * Since the win32 implementation uses non-blocking sockets behind the scenes in order to deliver signals correctly, implements a version of SSL_accept() that can handle this. Also, add a wait function in case SSL_read or SSL_write() needs more data. I'd appreciate it if one of the win32 guys can confirm that this patch fixes the build for them as well. //Magnus Content-Description: win32_ssl.patch [ 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 7: don't forget to increase your free space map settings
Re: [PATCHES] pg_dumpall bug in PG 8.0b3 Win32 port
Andrew Dunstan wrote: Luiz K. Matsumura wrote: Hi, I tried to use pg_dumpall in Win32 and receive a error message like this: pg_dump.exe: [archiver (db)] connection to database test failed: FATAL: user 'postgres' does not exist Well, the word 'postgres' is the word is between simple quotations marks and later between double quotations marks. Then, I assume that the error must be in string that pg_dumpall mounts to execute pg_dump I modified pg_dumpall.c lines between 160 and 270 to add a #ifndef WIN32... #endif clause to pgdumpopts to store the parameters with double quotations intead simple quotation marks in case of WIN32 ports But, I don't have how to test it. Please, somebody can test and fix the pg_dumpall.c of oficial source ? Thanks in advance Luiz Please provide your patch as a context diff, not as the whole file, so we can see what is changed. cheers andrew ---(end of broadcast)--- TIP 8: explain analyze is your friend Ops, excuse-me. I'm a novice. *** pg_dumpall.cTue Oct 5 18:53:27 2004 --- pg_dumpall.c.oriTue Oct 5 21:59:42 2004 *** *** 180,195 case 'h': pghost = optarg; - #ifndef WIN32 appendPQExpBuffer(pgdumpopts, -h '%s', pghost); - #else - appendPQExpBuffer(pgdumpopts, -h \%s\, pghost); - #endif - break; - - case 'i': case 'o': appendPQExpBuffer(pgdumpopts, -%c, c); --- 180,188 *** *** 201,211 case 'p': pgport = optarg; - #ifndef WIN32 appendPQExpBuffer(pgdumpopts, -p '%s', pgport); - #else - appendPQExpBuffer(pgdumpopts, -p \%s\, pgport); - #endif break; case 's': --- 194,200 *** *** 214,233 break; case 'S': - #ifndef WIN32 appendPQExpBuffer(pgdumpopts, -S '%s', optarg); - #else - appendPQExpBuffer(pgdumpopts, -S \%s\, optarg); - #endif break; case 'U': pguser = optarg; - #ifndef WIN32 appendPQExpBuffer(pgdumpopts, -U '%s', pguser); - #else - appendPQExpBuffer(pgdumpopts, -U \%s\, pguser); - #endif break; case 'v': --- 203,214 ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
[PATCHES] Win32 libpq/ssl fix
The Win32 (mingw) build of libpq seems to have lost it's SSL libs from the link step resulting in a build failure. The attached patch fixes that. Please apply asap. Thanks, Dave libpq_ssl.patch Description: libpq_ssl.patch ---(end of broadcast)--- TIP 8: explain analyze is your friend
[PATCHES] Win32 VERSIONINFO fix
Unfortunately some re-jigging of Magnus' Win32 version patch broke the build by introducing some un-escaped double quotes into sed commands. The attached patch escapes those quotes without removing the re-jigging that was done. Regards, Dave. filedesc.diff Description: filedesc.diff ---(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] pg_dumpall bug in PG 8.0b3 Win32 port
Luiz K. Matsumura [EMAIL PROTECTED] writes: I modified pg_dumpall.c lines between 160 and 270 to add a #ifndef WIN32... #endif clause to pgdumpopts to store the parameters with double quotations intead simple quotation marks in case of WIN32 ports This seems unnecessarily ugly. Why not just go over to double quotes? regards, tom lane ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Re: [PATCHES] Win32 VERSIONINFO fix
Unfortunately some re-jigging of Magnus' Win32 version patch broke the build by introducing some un-escaped double quotes into sed commands. The attached patch escapes those quotes without removing the re-jigging that was done. Hmm, this approach seems to make it even less readable :-) If I understood it right Bruce added the double quotes to the Makefiles because he thought having a text string there without quotes was bad. But having to escape them there is surely worse! The original patch added the quotes in the sed rule. If we want to keep the quotes in the Makefile:s, we should proably try to fix this problem at the sed rule, not in every Makefile. If we can't, then my vote is to go back to the orignial patch and remove the quotes from the Makefiles completely. I'm busy with other stuff right now, but I'll take a look at it as soon as i can unless someone has already fixed it. This being sed-and-makefile stuff I'm sure there are others who are more fluent in it than me :-) //Magnus ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Re: [PATCHES] Win32 VERSIONINFO fix
-Original Message- From: Magnus Hagander [mailto:[EMAIL PROTECTED] Sent: 06 October 2004 15:27 To: Dave Page; PostgreSQL-patches Subject: RE: [PATCHES] Win32 VERSIONINFO fix Unfortunately some re-jigging of Magnus' Win32 version patch broke the build by introducing some un-escaped double quotes into sed commands. The attached patch escapes those quotes without removing the re-jigging that was done. Hmm, this approach seems to make it even less readable :-) If I understood it right Bruce added the double quotes to the Makefiles because he thought having a text string there without quotes was bad. But having to escape them there is surely worse! I never said it was pretty, and as you didn't tell me why Bruce added the quotes when we spoke before... :-) The original patch added the quotes in the sed rule. If we want to keep the quotes in the Makefile:s, we should proably try to fix this problem at the sed rule, not in every Makefile. If we can't, then my vote is to go back to the orignial patch and remove the quotes from the Makefiles completely. I can do the latter if that's what ppl want. Like you though I'd need some sed help to leave the quotes in the Makefiles without escaping them. /D ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
Re: [PATCHES] Win32 VERSIONINFO fix
OK, I adjusted the sed script in CVS and Dave tested it. I also updated the win32ver.rc file to 8,0,000,000. --- Dave Page wrote: -Original Message- From: Magnus Hagander [mailto:[EMAIL PROTECTED] Sent: 06 October 2004 15:27 To: Dave Page; PostgreSQL-patches Subject: RE: [PATCHES] Win32 VERSIONINFO fix Unfortunately some re-jigging of Magnus' Win32 version patch broke the build by introducing some un-escaped double quotes into sed commands. The attached patch escapes those quotes without removing the re-jigging that was done. Hmm, this approach seems to make it even less readable :-) If I understood it right Bruce added the double quotes to the Makefiles because he thought having a text string there without quotes was bad. But having to escape them there is surely worse! I never said it was pretty, and as you didn't tell me why Bruce added the quotes when we spoke before... :-) The original patch added the quotes in the sed rule. If we want to keep the quotes in the Makefile:s, we should proably try to fix this problem at the sed rule, not in every Makefile. If we can't, then my vote is to go back to the orignial patch and remove the quotes from the Makefiles completely. I can do the latter if that's what ppl want. Like you though I'd need some sed help to leave the quotes in the Makefiles without escaping them. /D ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster -- 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] Win32 libpq/ssl fix
Patch applied. Thanks. --- Dave Page wrote: The Win32 (mingw) build of libpq seems to have lost it's SSL libs from the link step resulting in a build failure. The attached patch fixes that. Please apply asap. Thanks, Dave Content-Description: libpq_ssl.patch [ Attachment, skipping... ] ---(end of broadcast)--- TIP 8: explain analyze is your friend -- 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 6: Have you searched our list archives? http://archives.postgresql.org
Re: [PATCHES] pg_dumpall bug in PG 8.0b3 Win32 port
Patch applied. Thanks. --- Luiz K. Matsumura wrote: Andrew Dunstan wrote: Luiz K. Matsumura wrote: Hi, I tried to use pg_dumpall in Win32 and receive a error message like this: pg_dump.exe: [archiver (db)] connection to database test failed: FATAL: user 'postgres' does not exist Well, the word 'postgres' is the word is between simple quotations marks and later between double quotations marks. Then, I assume that the error must be in string that pg_dumpall mounts to execute pg_dump I modified pg_dumpall.c lines between 160 and 270 to add a #ifndef WIN32... #endif clause to pgdumpopts to store the parameters with double quotations intead simple quotation marks in case of WIN32 ports But, I don't have how to test it. Please, somebody can test and fix the pg_dumpall.c of oficial source ? Thanks in advance Luiz Please provide your patch as a context diff, not as the whole file, so we can see what is changed. cheers andrew ---(end of broadcast)--- TIP 8: explain analyze is your friend Ops, excuse-me. I'm a novice. *** pg_dumpall.c Tue Oct 5 18:53:27 2004 --- pg_dumpall.c.ori Tue Oct 5 21:59:42 2004 *** *** 180,195 case 'h': pghost = optarg; - #ifndef WIN32 appendPQExpBuffer(pgdumpopts, -h '%s', pghost); - #else - appendPQExpBuffer(pgdumpopts, -h \%s\, pghost); - #endif - break; - - case 'i': case 'o': appendPQExpBuffer(pgdumpopts, -%c, c); --- 180,188 *** *** 201,211 case 'p': pgport = optarg; - #ifndef WIN32 appendPQExpBuffer(pgdumpopts, -p '%s', pgport); - #else - appendPQExpBuffer(pgdumpopts, -p \%s\, pgport); - #endif break; case 's': --- 194,200 *** *** 214,233 break; case 'S': - #ifndef WIN32 appendPQExpBuffer(pgdumpopts, -S '%s', optarg); - #else - appendPQExpBuffer(pgdumpopts, -S \%s\, optarg); - #endif break; case 'U': pguser = optarg; - #ifndef WIN32 appendPQExpBuffer(pgdumpopts, -U '%s', pguser); - #else - appendPQExpBuffer(pgdumpopts, -U \%s\, pguser); - #endif break; case 'v': --- 203,214 ---(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 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
Re: [PATCHES] pg_dumpall bug in PG 8.0b3 Win32 port
Andrew Dunstan wrote: Bruce Momjian wrote: Tom Lane wrote: Luiz K. Matsumura [EMAIL PROTECTED] writes: I modified pg_dumpall.c lines between 160 and 270 to add a #ifndef WIN32... #endif clause to pgdumpopts to store the parameters with double quotations intead simple quotation marks in case of WIN32 ports This seems unnecessarily ugly. Why not just go over to double quotes? The patch was actually posted backward so maybe it wasn't clear but the change is to use double quotes instead of single quotes for Win32 arguments just like we do in other cases in pg_dumpall.c. Single quotes do not behave the same as single quotes in the WIn32 CMD.EXES processor. For example, DIR and DIR '' produce different results. Yes, but wasn't Tom's point that we could use double quotes on Unix too? That makes sense to me unless we expect some horrible interpolation effects. Oh, OK. Well, if we use double-quotes we don't allow double-quotes in the input, as well adding handling of dollar signs and other things. Single quotes are more robust under Unix and I don't want to risk changing that. -- 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 2: you can get off all lists at once with the unregister command (send unregister YourEmailAddressHere to [EMAIL PROTECTED])
Re: [PATCHES] pg_config fixes
Patch applied. Thanks. --- Euler Taveira de Oliveira wrote: Hi, This simple patch fixes a typo, ensure pg_config is removed in win32 and correct some splitted message mistake. Please apply. PS I'll send the translated file soon. = Euler Taveira de Oliveira euler[at]yahoo_com_br ___ Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! http://br.acesso.yahoo.com/ Content-Description: pg_config.diff *** ./src/bin/pg_config/Makefile.orig 2004-10-05 15:10:04.0 -0300 --- ./src/bin/pg_config/Makefile 2004-10-05 15:11:48.0 -0300 *** *** 1,6 #- # ! # Makefile for src/bin/pg_controldata # # Copyright (c) 1998-2002, PostgreSQL Global Development Group # --- 1,6 #- # ! # Makefile for src/bin/pg_config # # Copyright (c) 1998-2002, PostgreSQL Global Development Group # *** *** 28,34 $(mkinstalldirs) $(DESTDIR)$(bindir) uninstall: ! rm -f $(DESTDIR)$(bindir)/pg_config clean distclean maintainer-clean: rm -f pg_config$(X) $(OBJS) --- 28,34 $(mkinstalldirs) $(DESTDIR)$(bindir) uninstall: ! rm -f $(DESTDIR)$(bindir)/pg_config$(X) clean distclean maintainer-clean: rm -f pg_config$(X) $(OBJS) *** ./src/bin/pg_config/pg_config.c.orig 2004-10-05 15:32:13.0 -0300 --- ./src/bin/pg_config/pg_config.c 2004-10-05 15:32:18.0 -0300 *** *** 38,51 printf(_( %s OPTION...\n\n), progname); printf(_(Options:\n)); printf(_( --bindir show location of user executables\n)); ! printf(_( --includedir show location of C header files of the client\n)); ! printf(_(interfaces\n)); printf(_( --includedir-server show location of C header files for the server\n)); printf(_( --libdir show location of object code libraries\n)); printf(_( --pkglibdir show location of dynamically loadable modules\n)); printf(_( --pgxsshow location of extension makefile\n)); ! printf(_( --configure show options given to 'configure' script when\n)); ! printf(_(PostgreSQL was built\n)); printf(_( --version show the PostgreSQL version, then exit\n)); printf(_( --helpshow this help, then exit\n\n)); printf(_(Report bugs to [EMAIL PROTECTED].\n)); --- 38,51 printf(_( %s OPTION...\n\n), progname); printf(_(Options:\n)); printf(_( --bindir show location of user executables\n)); ! printf(_( --includedir show location of C header files of the client\n ! interfaces\n)); printf(_( --includedir-server show location of C header files for the server\n)); printf(_( --libdir show location of object code libraries\n)); printf(_( --pkglibdir show location of dynamically loadable modules\n)); printf(_( --pgxsshow location of extension makefile\n)); ! printf(_( --configure show options given to 'configure' script when\n ! PostgreSQL was built\n)); printf(_( --version show the PostgreSQL version, then exit\n)); printf(_( --helpshow this help, then exit\n\n)); printf(_(Report bugs to [EMAIL PROTECTED].\n)); ---(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 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html
[PATCHES] Warning for psql history not supported
Here is an applied patch that suppresses psql \s help display for platforms like Win32 that don't typically install with readline. It also prints and error if you try to access it. -- 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: doc/src/sgml/ref/psql-ref.sgml === RCS file: /cvsroot/pgsql-server/doc/src/sgml/ref/psql-ref.sgml,v retrieving revision 1.122 diff -c -c -r1.122 psql-ref.sgml *** doc/src/sgml/ref/psql-ref.sgml 20 Sep 2004 18:51:17 - 1.122 --- doc/src/sgml/ref/psql-ref.sgml 6 Oct 2004 18:34:40 - *** *** 1603,1609 class=parameterfilename/replaceable is omitted, the history is written to the standard output. This option is only available if applicationpsql/application is configured to use the ! acronymGNU/acronym history library. /para note --- 1603,1609 class=parameterfilename/replaceable is omitted, the history is written to the standard output. This option is only available if applicationpsql/application is configured to use the ! acronymGNU/acronym readline (or history) library. /para note Index: src/bin/psql/help.c === RCS file: /cvsroot/pgsql-server/src/bin/psql/help.c,v retrieving revision 1.93 diff -c -c -r1.93 help.c *** src/bin/psql/help.c 29 Aug 2004 05:06:54 - 1.93 --- src/bin/psql/help.c 6 Oct 2004 18:34:44 - *** *** 194,200 --- 194,202 fprintf(output, _( \\g [FILE] send query buffer to server (and results to file or |pipe)\n)); fprintf(output, _( \\p show the contents of the query buffer\n)); fprintf(output, _( \\r reset (clear) the query buffer\n)); + #ifdef USE_READLINE fprintf(output, _( \\s [FILE] display history or save it to file\n)); + #endif fprintf(output, _( \\w FILEwrite query buffer to file\n)); fprintf(output, \n); Index: src/bin/psql/input.c === RCS file: /cvsroot/pgsql-server/src/bin/psql/input.c,v retrieving revision 1.38 diff -c -c -r1.38 input.c *** src/bin/psql/input.c27 Sep 2004 19:16:02 - 1.38 --- src/bin/psql/input.c6 Oct 2004 18:34:44 - *** *** 209,214 --- 209,216 psql_error(could not save history to file \%s\: %s\n, fname, strerror(errno)); } + #else + psql_error(history is not supported on this platform\n); #endif return false; ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [PATCHES] Warning for psql history not supported
I changed it to history is not supported. --- Bruce Momjian wrote: Peter Eisentraut wrote: Bruce Momjian wrote: Here is an applied patch that suppresses psql \s help display for platforms like Win32 that don't typically install with readline. It also prints and error if you try to access it. But history is not supported on this platform is not really true, is it? No, not really, but that's what we say when we can't create a symlink so I used the same wording. What would be the proper wording? I couldn't find another example. -- 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 -- 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 6: Have you searched our list archives? http://archives.postgresql.org
Re: [PATCHES] document rep; no black magic
On Wed, 2004-10-06 at 17:04, Neil Conway wrote: This patch adds a comment that describes what the rep; no sequence in spin_delay() does, in src/include/storage/s_lock.h Patch applied to HEAD. (Of course, I meant to write rep; nop in the previous mail -- typo'd twice...) -Neil ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
[PATCHES] [psql] Setting the PROMPT on command line
Hi there, I wrote a tiny patch to prevent psql from overwriting the PROMPT[1-3] variables with default values after parsing the command line. That way the prompt can be set from the command line by using: psql -v PROMPT1=... The patch is against postgres 7.4.5, but it's so trivial it should be possible to apply it to CVS without changes. Cheers, Ingo diff -ur postgresql-7.4.5/src/bin/psql/startup.c postgresql-7.4.5_hack/src/bin/psql/startup.c --- postgresql-7.4.5/src/bin/psql/startup.c 2003-09-29 20:21:33.0 +0200 +++ postgresql-7.4.5_hack/src/bin/psql/startup.c2004-10-07 01:34:32.656452439 +0200 @@ -280,9 +280,12 @@ } /* Default values for variables that are used in interactive case */ - SetVariable(pset.vars, PROMPT1, DEFAULT_PROMPT1); - SetVariable(pset.vars, PROMPT2, DEFAULT_PROMPT2); - SetVariable(pset.vars, PROMPT3, DEFAULT_PROMPT3); + if (!GetVariable(pset.vars, PROMPT1)) + SetVariable(pset.vars, PROMPT1, DEFAULT_PROMPT1); + if (!GetVariable(pset.vars, PROMPT2)) + SetVariable(pset.vars, PROMPT2, DEFAULT_PROMPT2); + if (!GetVariable(pset.vars, PROMPT3)) + SetVariable(pset.vars, PROMPT3, DEFAULT_PROMPT3); if (!options.no_psqlrc) process_psqlrc(); ---(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] s_lock_test build fix
On Wed, 2004-10-06 at 14:36, Neil Conway wrote: This trivial patch allows make -C src/backend/storage/lmgr/ s_lock_test to succeed in vpath builds. Patch applied to HEAD. -Neil ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
Re: [PATCHES] [psql] Setting the PROMPT on command line
On Thu, 2004-10-07 at 10:04, Ingo van Lil wrote: I wrote a tiny patch to prevent psql from overwriting the PROMPT[1-3] variables with default values after parsing the command line. Looks good to me. Does anyone object to applying this for 8.0? -Neil ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html
Re: [PATCHES] [psql] Setting the PROMPT on command line
Neil Conway [EMAIL PROTECTED] writes: On Thu, 2004-10-07 at 10:04, Ingo van Lil wrote: I wrote a tiny patch to prevent psql from overwriting the PROMPT[1-3] variables with default values after parsing the command line. Looks good to me. Does anyone object to applying this for 8.0? I'm just wondering if the fix is in the right place. Doesn't the same issue arise for other variables? Maybe what we have to do is postpone command-line-driven settings of variables until sometime later than it's done now. regards, tom lane ---(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] pg_ctl: WIN32 for CYGWIN also (services)
I'd like to have this nice new features also :) Just redefine WIN32 #ifdef __CYGWIN___ or the clean and long way as in my patch? I'm not sure about any dirty side-effects. Builds fine and works as expected. (Just tablespace symlinks not yet. Will get to that soon.) --- postgresql-8.0.0cvs/src/bin/pg_ctl/pg_ctl.c.orig2004-09-02 22:07:50.0 +0200 +++ postgresql-8.0.0cvs/src/bin/pg_ctl/pg_ctl.c 2004-10-07 05:29:28.938946400 +0200 @@ -20,6 +20,9 @@ #include libpq/pqsignal.h #include getopt_long.h +#if defined(__CYGWIN__) +#include windows.h +#endif #ifndef HAVE_OPTRESET intoptreset; @@ -95,7 +98,7 @@ static void do_status(void); static void do_kill(pgpid_t pid); -#ifdef WIN32 +#if defined(WIN32) || defined(__CYGWIN__) static bool pgwin32_IsInstalled(SC_HANDLE); static char *pgwin32_CommandLine(bool); static void pgwin32_doRegister(); @@ -116,7 +119,7 @@ static char conf_file[MAXPGPATH]; -#ifdef WIN32 +#if defined(WIN32) || defined(__CYGWIN__) static void write_eventlog(int level, const char *line) { @@ -154,7 +157,7 @@ va_list ap; va_start(ap, fmt); -#ifndef WIN32 +#if defined(WIN32) || defined(__CYGWIN__) /* On Unix, we just fprintf to stderr */ vfprintf(stderr, fmt, ap); #else @@ -317,7 +320,7 @@ * http://dev.remotenetworktechnology.com/cmd/cmdfaq.htm */ if (log_file != NULL) -#ifndef WIN32 +#if defined(WIN32) || defined(__CYGWIN__) snprintf(cmd, MAXPGPATH, %s\%s\ %s%s \%s\ \%s\ 21 %s, #else snprintf(cmd, MAXPGPATH, %sSTART /B \\ \%s\ %s%s \%s\ \%s\ 21%s, @@ -325,7 +328,7 @@ SYSTEMQUOTE, postgres_path, pgdata_opt, post_opts, DEVNULL, log_file, SYSTEMQUOTE); else -#ifndef WIN32 +#if defined(WIN32) || defined(__CYGWIN__) snprintf(cmd, MAXPGPATH, %s\%s\ %s%s \%s\ 21 %s, #else snprintf(cmd, MAXPGPATH, %sSTART /B \\ \%s\ %s%s \%s\ 21%s, @@ -803,7 +806,7 @@ } } -#ifdef WIN32 +#if defined(WIN32) || defined(__CYGWIN__) static bool pgwin32_IsInstalled(SC_HANDLE hSCM) @@ -1197,7 +1200,7 @@ int c; pgpid_t killproc = 0; -#ifdef WIN32 +#if defined(WIN32) || defined(__CYGWIN__) setvbuf(stderr, NULL, _IONBF, 0); #endif @@ -1344,7 +1347,7 @@ set_sig(argv[++optind]); killproc = atol(argv[++optind]); } -#ifdef WIN32 +#if defined(WIN32) || defined(__CYGWIN__) else if (strcmp(argv[optind], register) == 0) ctl_command = REGISTER_COMMAND; else if (strcmp(argv[optind], unregister) == 0) @@ -1434,7 +1437,7 @@ case KILL_COMMAND: do_kill(killproc); break; -#ifdef WIN32 +#if defined(WIN32) || defined(__CYGWIN__) case REGISTER_COMMAND: pgwin32_doRegister(); break; ---(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] [psql] Setting the PROMPT on command line
Neil Conway [EMAIL PROTECTED] writes: On Thu, 2004-10-07 at 13:05, Tom Lane wrote: I'm just wondering if the fix is in the right place. Doesn't the same issue arise for other variables? Well, we don't manually set other variables in psql itself, with the exception of defining some default values before we process command-line args or psqlrc (see startup.c circa line 141) -- so in that case allowing the value to be overriden is fine. [ eyeballs that... ] So a much simpler fix for Ingo's complaint would be to move the default settings of PROMPT1 et al (lines 303-306) to the vicinity of line 141. I can't see that skipping these setup operations in the noninteractive case is worthwhile. On looking at the code closer though, I do see one related problem: we process command-line args before we read psqlrc, so psqlrc settings can override what was specified on the command-line. Shouldn't this happen in reverse? I tend to agree, but it's somewhat debatable. Would it be simple to change? regards, tom lane ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Re: [PATCHES] [psql] Setting the PROMPT on command line
On Thu, 2004-10-07 at 13:05, Tom Lane wrote: I'm just wondering if the fix is in the right place. Doesn't the same issue arise for other variables? Well, we don't manually set other variables in psql itself, with the exception of defining some default values before we process command-line args or psqlrc (see startup.c circa line 141) -- so in that case allowing the value to be overriden is fine. On looking at the code closer though, I do see one related problem: we process command-line args before we read psqlrc, so psqlrc settings can override what was specified on the command-line. Shouldn't this happen in reverse? -Neil ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html
[PATCHES] pg_config translation to pt_BR
Hi, Here is a patch to available the first translation of pg_config. The files attached needs to be in src/bin/pg_config. Basically, it is two files (nls.mk, pt_BR.po) and one directory (po/). Please apply. = Euler Taveira de Oliveira euler[at]yahoo_com_br ___ Yahoo! Acesso Grátis - Internet rápida e grátis. Instale o discador agora! http://br.acesso.yahoo.com/ pg_config.tgz Description: pg_config.tgz ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html