Re: Simple postgresql.conf wizard

From: Greg Smith <gsmith(at)gregsmith(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Simple postgresql.conf wizard
Date: 2008-12-01 17:43:37
Message-ID: Pine.GSO.4.64.0812011235280.13553@westnet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 1 Dec 2008, Robert Haas wrote:

> I just gave this a try and got:
>
> $ ./pgtune
> Traceback (most recent call last):
> File "./pgtune", line 20, in <module>
> from ctypes.wintypes import *
> File "/usr/lib/python2.5/ctypes/wintypes.py", line 21, in <module>
> class VARIANT_BOOL(_SimpleCData):
> ValueError: _type_ 'v' not supported

Looks like I need to add Python 2.5+Linux to my testing set. I did not
expect that the UNIX distributions of Python 2.5 would ship with
wintypes.py at all. I think I can fix this on the spot though. On line
40, you'll find this bit:

except ImportError:

Change that to the following:

except ImportError,ValueError:

And it should pass that point. If it doesn't, you can try the completely
general:

except:

And then it should be OK. I should probably use that formulation in that
particular section.

> (This is also my #1 beef with Python: too many utterly impenetrable
> error messages... or at least impenetrable to me.)

That one made sense to me, but that is one of the sharper parts of its
learning curve. I think part of the problem is that much of the tutorial
Python code out there never gets into error handling. One of the things
Java does that I miss is that if you create a "try" block, it won't work
until you have addressed every possible exception the code in there can
generate. It may be impractical for Python to know that much, but I
wonder if a lint-ish tool for the language might be able to do it.

The above mumbling is certainly off-topic for this list though.

--
* Greg Smith gsmith(at)gregsmith(dot)com http://www.gregsmith.com Baltimore, MD

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Smith 2008-12-01 17:54:43 Re: Simple postgresql.conf wizard
Previous Message Tom Lane 2008-12-01 17:40:01 Re: Simple postgresql.conf wizard