[PATCHES] New FAQ questions. minor fixes

2005-02-23 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
 
 
Added a new question about sorting with a NULL. Also some minor
cleanups, especially in regards to some of the http links: is
some automatic tool messing these up somehow? (many had spaces
and odd breaks in the middle)
 
- --
Greg Sabino Mullane [EMAIL PROTECTED]
PGP Key: 0x14964AC8 20050021
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-BEGIN PGP SIGNATURE-
 
iD8DBQFCG9qnvJuQZxSWSsgRAnNXAKC8gPJ3m3kuHjfUZxOTLPGqDZ/S6ACguXQT
vKrfqPdiL1yZ9HHt8j0tRBc=
=9cAH
-END PGP SIGNATURE-

Index: FAQ
===
RCS file: /projects/cvsroot/pgsql/doc/FAQ,v
retrieving revision 1.331
diff -c -r1.331 FAQ
*** FAQ	15 Feb 2005 04:35:30 -	1.331
--- FAQ	23 Feb 2005 01:16:56 -
***
*** 79,84 
--- 79,85 
 4.20) Why do I get missing oid errors when accessing temporary
 tables in PL/PgSQL functions?
 4.21) What encryption options are available?
+4.22) How can I sort on whether a field is NULL or not?
 
  Extending PostgreSQL

***
*** 119,125 
 PostgreSQL Data Base Management System
 
 Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
!Portions Copyright (c) 1994-6 Regents of the University of California
 
 Permission to use, copy, modify, and distribute this software and its
 documentation for any purpose, without fee, and without a written
--- 120,126 
 PostgreSQL Data Base Management System
 
 Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
!Portions Copyright (c) 1994-1996 Regents of the University of California
 
 Permission to use, copy, modify, and distribute this software and its
 documentation for any purpose, without fee, and without a written
***
*** 152,166 
 http://pgfoundry.org/projects/pginstaller. MSDOS-based versions of
 Windows (Win95, Win98, WinMe) can run PostgreSQL using Cygwin.
 
!There is also a Novell Netware 6 port at http://forge.novell.com, and
!an OS/2 (eComStation) version at
!http://hobbes.nmsu.edu/cgi-bin/h-search?sh=1button=Searchkey=postgre
!SQLstype=allsort=typedir=%2F.
 
  1.4) Where can I get PostgreSQL?
  
 The primary anonymous ftp site for PostgreSQL is
!ftp://ftp.PostgreSQL.org/pub. For mirror sites, see our main web site.
 
  1.5) Where can I get support?
  
--- 153,166 
 http://pgfoundry.org/projects/pginstaller. MSDOS-based versions of
 Windows (Win95, Win98, WinMe) can run PostgreSQL using Cygwin.
 
!There is also a Novell Netware 6 port at http://forge.novell.com, 
!and an OS/2 (eComStation) version at
!http://hobbes.nmsu.edu/cgi-bin/h-search?sh=1key=postgresql+port
 
  1.4) Where can I get PostgreSQL?
  
 The primary anonymous ftp site for PostgreSQL is
!ftp://ftp.PostgreSQL.org/pub/. For mirror sites, see our main web site.
 
  1.5) Where can I get support?
  
***
*** 177,183 
 EFNet.
 
 A list of commercial support companies is available at
!http://techdocs.postg resql.org/companies.php.
 
  1.6) How do I submit a bug report?
  
--- 177,183 
 EFNet.
 
 A list of commercial support companies is available at
!http://techdocs.postgresql.org/companies.php.
 
  1.6) How do I submit a bug report?
  
***
*** 318,333 
 For Web integration, PHP (http://www.php.net) is an excellent
 interface.
 
!For complex cases, many use the Perl and CGI.pm or mod_perl.
 
  2.3) Does PostgreSQL have a graphical user interface?
  
 Yes, there are several graphical interfaces to PostgreSQL available.
 These include pgAdmin III (http://www.pgadmin.org, PgAccess
!http://www.pgaccess.org), RHDB Admin (http://sources.redhat.com/rhd b/
!), TORA (http://www.globecom.net/tora/, partly commercial), and Rekall
!( http://www.rekallrevealed.org/). There is also PhpPgAdmin (
!http://phppgadmin.sourceforge.net/ ), a web-based interface to
 PostgreSQL.
 
 See http://techdocs.postgresql.org/guides/GUITools for a more detailed
--- 318,333 
 For Web integration, PHP (http://www.php.net) is an excellent
 interface.
 
!For complex cases, many use Perl and DBD::Pg with CGI.pm or mod_perl.
 
  2.3) Does PostgreSQL have a graphical user interface?
  
 Yes, there are several graphical interfaces to PostgreSQL available.
 These include pgAdmin III (http://www.pgadmin.org, PgAccess
!(http://www.pgaccess.org), RHDB Admin (http://sources.redhat.com/rhdb/),
!TORA (http://www.globecom.net/tora/, partly commercial), and Rekall
!(http://www.rekallrevealed.org/). There is also PhpPgAdmin 
!

Re: [PATCHES] optimize md5_text

2005-02-23 Thread Neil Conway
Neil Conway wrote:
This patch optimizes the md5_text() function (which is used to implement 
the md5() SQL-level function).
Applied.
-Neil
---(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] A way to let Vacuum warn if FSM settings are low.

2005-02-23 Thread Ron Mayer
Short summary:

  I find this tiny (9-line) patch useful to help my clients know 
  when FSM settings may need updating.

Some of the more frequently asked questions here are in regards to FSM
settings.  One hint I've seen is to run vacuum verbose;.  At the end 
of thousands of lines of INFO and DETAIL messages vacuum verbose has 2
separate lines with some numbers to compare (total pages needed and 
FSM size...pages) that help indicate too low fsm settings.


I've gotten into the habit of always installing the following patch
(below) that automatically does this comparison for me, and if
max_fsm_pages is too small, it logs a warning as shown here:

 patched=# vacuum;
 WARNING:  max_fsm_pages(1601) is smaller than total pages needed(2832)
 VACUUM

I find this much nicer than the existing output (
 clean=# vacuum verbose;
 [. thousands of lines of INFO and DETAIL messages ]
 INFO:  free space map: 77 relations, 470 pages stored; 2832 total pages needed
 DETAIL:  Allocated FSM size: 100 relations + 1601 pages = 19 kB shared memory.
) for many reasons:
 * First, because it's a warning, lots of people will notice it before 
   their asking the FAQ again.
 * Second, because all the information is on a single line and actually
   contains the string max_fsm_relations, it gives people a clue what 
   to do about it. (note that vacuum verbose uses similar phrases but
   from the number of questions here, it must not be obvious)
 * Third, I don't need the 'verbose' setting.
 * And most importantly, our clients let us know about WARNINGs, 
   but not about INFOs or DETAILs in their log page; so it gives 
   us a chance to respond before their system drags to a halt.

If a patch like this could get into the standard distro, that'd be
awesome - just let me know what additional work is needed (I didn't
look at docs or internationalization yet).  If not, I'd like to post 
it here to patches just in case anyone else will benefit from the 
same thing.


   ==
% diff -u postgresql-8.0.1/src/backend/storage/freespace/freespace.c 
postgresql-patched/src/backend/storage/freespace/freespace.c
--- postgresql-8.0.1/src/backend/storage/freespace/freespace.c2004-12-31 
14:00:54.0 -0800
+++ postgresql-patched/src/backend/storage/freespace/freespace.c2005-02-23 
14:58:50.638745744 -0800
@@ -704,6 +704,15 @@
 
 /* Convert stats to actual number of page slots needed */
 needed = (sumRequests + numRels) * CHUNKPAGES;
+
+if (needed  MaxFSMPages)
+ereport(WARNING,
+(errmsg(max_fsm_pages(%d) is smaller than total pages 
needed(%.0f),
+ MaxFSMPages, needed)));
+if (numRels  MaxFSMRelations)
+ereport(WARNING,
+(errmsg(max_fsm_relations(%d) is smaller than the number of 
relations (%d),
+ MaxFSMRelations, numRels)));
 
 ereport(elevel,
 (errmsg(free space map: %d relations, %d pages stored; %.0f total 
pages needed,
   ==


  Thoughts? 
  Ron


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [PATCHES] A way to let Vacuum warn if FSM settings are low.

2005-02-23 Thread Tom Lane
Ron Mayer [EMAIL PROTECTED] writes:
 +if (needed  MaxFSMPages)
 +ereport(WARNING,
 +(errmsg(max_fsm_pages(%d) is smaller than total pages 
 needed(%.0f),
 + MaxFSMPages, needed)));

An unconditional WARNING seems a bit strong to me for a case that is not
necessarily wrong.  Depending on the needs of the installation, this
might be a perfectly acceptable situation --- for example if you have
lots of large read-mostly tables.

On the other side of the coin, the test could pass (ie no warning) in
situations where in fact MaxFSMPages is too small, because what we are
comparing it to is the number of pages requested for relations that are
being tracked.  If MaxFSMRelations is too small then we can't really
tell whether MaxFSMPages is adequate.

 +if (numRels  MaxFSMRelations)
 +ereport(WARNING,
 +(errmsg(max_fsm_relations(%d) is smaller than the number of 
 relations (%d),
 + MaxFSMRelations, numRels)));

This part is just plain dead code, since it's not possible for numRels
to exceed MaxFSMRelations.

I think it might be useful to warn when numRels == MaxFSMRelations,
since if you don't have even one spare fsmrel slot then you probably
have too few (it's unlikely you got it on the nose).  But I don't know
how to produce a warning about MaxFSMPages that's worth anything.

regards, tom lane

---(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] optimize md5_text

2005-02-23 Thread John Hansen
Will this be backpatched to 8.0? 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Neil Conway
 Sent: Thursday, February 24, 2005 9:46 AM
 To: pgsql-patches
 Subject: Re: [PATCHES] optimize md5_text
 
 Neil Conway wrote:
  This patch optimizes the md5_text() function (which is used to 
  implement the md5() SQL-level function).
 
 Applied.
 
 -Neil
 
 ---(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
 
 

---(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] optimize md5_text

2005-02-23 Thread Neil Conway
John Hansen wrote:
Will this be backpatched to 8.0?
Since it's just a performance optimization, I wasn't planning to 
backpatch it, no. I suppose the OOM fix might be worth backporting, 
although that is more of a theoretical problem than something I would 
expect to actually occur in practice.

-Neil
---(end of broadcast)---
TIP 6: Have you searched our list archives?
  http://archives.postgresql.org


Re: [PATCHES] [pgsql-hackers-win32] Repleacement for src/port/snprintf.c

2005-02-23 Thread Tom Lane
Kurt Roeckx [EMAIL PROTECTED] writes:
 The configure test is a little broken.  It needs to quote the
 $'s.

 I've rewritten the test a little.

Applied, thanks.

regards, tom lane

---(end of broadcast)---
TIP 8: explain analyze is your friend